本文摘自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的选择语句是什么语句
Python中tornado同步与异步i/o实例代码讲解
Python dict怎么实现的
Python刷题用哪个app
Python中复数怎么表示
Python实现下载文件的三种方法_Python
Python如何使用列表推导式
更多相关阅读请进入《Python》频道 >>
人民邮电出版社
python入门书籍,非常畅销,超高好评,python官方公认好书。
转载请注明出处:木庄网络博客 » Python中关于字典dict的使用详解