码迷,mamicode.com
首页 > 其他好文 > 详细

字典和集合

时间:2018-10-29 23:00:48      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:方法   zip   class   字典   one   span   print   code   style   

字典构造方法:

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

print(a==b==c==d==e)

输出:
True

 

字典和集合

标签:方法   zip   class   字典   one   span   print   code   style   

原文地址:https://www.cnblogs.com/StackNeverOverFlow/p/9873764.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!