lists and Dictionaries
摘要:
>>> print {i : chr(65+i) for i in range(4)} {0 : 'A', 1 : 'B', 2 : 'C', 3 : 'D'} >>> print {k : v for k, v in someDict.iteritems()} == someDict.copy() 1 >>> print {x.lower() : 1 for x in list_of_email_addrs} {'barry@zope.com' : 1, 阅读全文
posted @ 2013-05-18 14:52 Ijavascript 阅读(151) 评论(0) 推荐(0) 编辑