创建字典的五种方式

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

你可能感兴趣的:(学习经验分享,python)