本文摘自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单元测试?(实例详解)
Python利用os模块批量修改文件名的方法介绍(附代码)
r语言和Python有必要都学吗
Python怎么生成时间戳
Python程序的运行过程如何理解?
Python中set集合属于可变类型吗
Python数据分析师需要学什么
Python开发环境是什么
Python中socket之客户端与服务端握手的实例
Python如何随机生成10个整数
更多相关阅读请进入《Python》频道 >>
人民邮电出版社
python入门书籍,非常畅销,超高好评,python官方公认好书。
转载请注明出处:木庄网络博客 » Python中关于字典dict的使用详解