Last active
August 29, 2015 14:01
-
-
Save Mause/1abe1941c20818b37423 to your computer and use it in GitHub Desktop.
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
>>> l = ['key1', 'value1', 'key2', 'value2'] | |
>>> l = map(str.strip, l) | |
>>> l = iter(l) # if not already an iterator | |
>>> d = dict(zip(l, l)) | |
>>> d | |
{ | |
'key1': 'value1', | |
'key2': 'value2' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment