手机
当前位置:查字典教程网 >脚本专栏 >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 参数列表中的self 显式不等于冗余

用python代码做configure文件

python getopt 参数处理小示例

python中cPickle用法例子分享

python数据结构树和二叉树简介

vc6编写python扩展的方法分享

python del()函数用法

Python 条件判断的缩写方法

python ip正则式

python 随机数生成的代码的详细分析

精品推荐
分类导航