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)
创建字典的五种方式
最新推荐文章于 2024-06-08 23:20:20 发布