本文摘自php中文网,作者黄舟,侵删。
这篇文章主要介绍了Python简单定义与使用字典的方法,结合简单实例形式分析了Python字典的原理、组成、定义及使用方法,需要的朋友可以参考下本文实例讲述了Python简单定义与使用字典的方法。分享给大家供大家参考,具体如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | print
dicDefine = {
'Name' : 'ewang' ,
'Age' : 28 ,
'Sex' : 'famale' ,
'BirthDay' : '1998/09/1'
}
print 'The content of dicDefind' ,dicDefine
print 'The keys of dicDefind' ,dicDefine.keys( )
print 'The values of dicDefind' ,dicDefine.values()
print 'The items of dicDefind' ,dicDefine.items()
|
运行结果:

以上就是Python中关于字典dict的使用详解的详细内容,更多文章请关注木庄网络博客!!
相关阅读 >>
Python之33个关键字是哪些
Python可迭代对象怎么理解
Python更改已存在excel文件的方法
pycharm怎么用Python
Python为什么这么火?
Python实现购物车的简单实例分享
安装Python时没有scripts文件夹如何处理
Python学习日记----线程,event,队列
Python绘制五角星
Python不支持的数据类型有哪些
更多相关阅读请进入《Python》频道 >>
人民邮电出版社
python入门书籍,非常畅销,超高好评,python官方公认好书。
转载请注明出处:木庄网络博客 » Python中关于字典dict的使用详解