Swap keys and values in a dict
swapped = dict(map(reversed, orig_dict.items()))
Written by v.petrov
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Related Tags
#python
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#