Last active
December 18, 2015 10:49
-
-
Save 91pavan/5770925 to your computer and use it in GitHub Desktop.
Convert a list into dictionary and dictionary into lists!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def zipdict(names, values): | |
return dict(zip(names, values)) | |
def unzipdict(mydict): | |
list1 = mydict.keys() | |
list2 = mydict.values() | |
return list1, list2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment