My Tech Notes
python: dictionary comprehension
dict = { 'a':1, 'b':2 }
dict = { k: str(dict[k]) for k in dict.keys() }
print(dict)
http://stackoverflow.com/questions/14507591/python-dictionary-comprehension
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment