python入门之五种字典创建方法

a = dict(one = 1, tow = 2, three = 3)
b = {'one' :1,'tow' :2 , 'three' :3}
c = dict (zip(['one', 'tow', 'three'],[1,2,3]))
d = dict((('one',1),('tow',2),('three',3)))
e = dict({'one' :1,'tow':2, 'three':3})
a=b=c=d=e

猜你喜欢

转载自www.cnblogs.com/heguoze/p/9250030.html
今日推荐