本文摘自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来理解递归(代码讲解)
Python 文件定位是什么?文件定位有什么作用?
Python如何做一个登录注册界面
Python3.7.2如何安装pil库
Python中怎样把矩阵转换为列表
Python中可以使用两种方法实现更新数据库脚本的示例
怎么把字符串解析成浮点数或者整数
Python之post登录实例代码
浅析Python数据处理
更多相关阅读请进入《Python》频道 >>
人民邮电出版社
python入门书籍,非常畅销,超高好评,python官方公认好书。
转载请注明出处:木庄网络博客 » Python中关于字典dict的使用详解