-
-
Save connectthefuture/7ed33d9b348002d7879df6d0c2132591 to your computer and use it in GitHub Desktop.
This file contains 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 dictify(s): | |
items = s.split() | |
for i, item in enumerate(items): | |
if ':' in item: | |
items[i] = item.split(':') | |
else: | |
items[i] = (item, True) | |
print dict(items) | |
s = 'foo bar:baz' | |
print dictify(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I need to apply this and review my outcomes.