Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Parse a unicode string in python to a dictionary
- keys = ['key1', 'key2', 'key3']
- words = u'word1 word2 word3'
- vals = words.split()
- d = dict(zip(keys, vals))
- ' '.join(sorted(k + ':' + v for k,v in d.items()))
Add Comment
Please, Sign In to add comment