手机
当前位置:查字典教程网 >脚本专栏 >python >python dict remove数组删除(del,pop)
python dict remove数组删除(del,pop)
摘要:比如代码binfo={'name':'jay','age':20,'python':'haha'}printbinfo.pop('name'...

比如代码

binfo = {'name':'jay','age':20,'python':'haha'}

print binfo.pop('name')#pop方法删除键,并且返回键对应的值

print binfo##输出结果:{'python': 'haha', 'age': 20}

del binfo['python']##内置方法删除元素

print binfo##输出结果:{'age': 20}

【python dict remove数组删除(del,pop)】相关文章:

Python ZipFile模块详解

Python操作SQLite简明教程

python数据结构之二叉树的遍历实例

python encode和decode的妙用

python k-近邻算法实例分享

Python 条件判断的缩写方法

vc6编写python扩展的方法分享

python下函数参数的传递(参数带星号的说明)

python 排列组合之itertools

python 参数列表中的self 显式不等于冗余

精品推荐
分类导航