本文摘自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中的sort的方法使用详解
Python的cmd命令行在哪里
Python中关于字符编码与函数的使用详解
Python怎么取消注释
分享Python snownlp的实例教程
Python做并行计算可以吗
Python和go语言有区别吗
Python怎么安装scipy
深入了解Python之django框架
Python中join是什么意思
更多相关阅读请进入《Python》频道 >>
人民邮电出版社
python入门书籍,非常畅销,超高好评,python官方公认好书。
转载请注明出处:木庄网络博客 » Python中关于字典dict的使用详解