手机
当前位置:查字典教程网 >脚本专栏 >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创建线程示例

python3.0 字典key排序

python操作xml文件示例

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

python ElementTree 基本读操作示例

python列表操作使用示例分享

python list语法学习(带例子)

python快速排序代码实例

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

python装饰器使用方法实例

精品推荐
分类导航