手机
当前位置:查字典教程网 >脚本专栏 >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 fabric实现远程操作和部署示例

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

python list语法学习(带例子)

python列表操作使用示例分享

Python中字典(dict)和列表(list)的排序方法实例

Python实现类继承实例

Python常见文件操作的函数示例代码

python装饰器使用方法实例

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

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

精品推荐
分类导航