码迷,mamicode.com
首页 > 编程语言 > 详细

python 初学 字典

时间:2018-11-14 01:06:10      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:而且   reverse   不同   put   bsp   output   png   orm   copy   

empty_dict={}
a_dict={one:1,two:2,three:3}
print ("{}".format(a_dict))
#reverse output!!!
#print ("{!s}".format(len(a_dict)))
#print ("{}".format(a_dict[‘two‘]))
a_new_dict=a_dict.copy()
print ("{!s}".format(a_new_dict))
a_new1_dict=a_dict.copy()
print("{!s}".format(a_new1_dict))
a_new2_dict=a_dict.copy()
print("{!s}".format(a_new2_dict))
#output order!!!

为什么对a_dict的copy输出顺序与a_dict不同,而且a_dict本身输出也不是他本来的顺序?

技术分享图片

 

python 初学 字典

标签:而且   reverse   不同   put   bsp   output   png   orm   copy   

原文地址:https://www.cnblogs.com/ryan-l/p/9955652.html

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