手机
当前位置:查字典教程网 >脚本专栏 >python >python字典基本操作实例分析
python字典基本操作实例分析
摘要:本文实例讲述了python字典基本操作。分享给大家供大家参考。具体如下:d2={'spam':2,'ham':1,'eggs':3}#mak...

本文实例讲述了python字典基本操作。分享给大家供大家参考。具体如下:

d2 = {'spam': 2, 'ham': 1, 'eggs': 3} # make a dictionary print d2 # order is scrambled d2['ham'] = ['grill', 'bake', 'fry'] # change entry del d2['eggs'] # delete entry d2['brunch'] = 'Bacon' # add new entry print d2

希望本文所述对大家的Python程序设计有所帮助。

【python字典基本操作实例分析】相关文章:

python ElementTree 基本读操作示例

python fabric实现远程操作和部署示例

Python写的一个简单DNS服务器实例

python算法学习之计数排序实例

Python写的贪吃蛇游戏例子

python迭代器的使用方法实例

Python基本数据类型详细介绍

python抓取网页内容示例分享

python创建线程示例

Python 文件读写操作实例详解

精品推荐
分类导航