手机
当前位置:查字典教程网 >脚本专栏 >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的id()函数解密过程

python list语法学习(带例子)

Python 可爱的大小写

Python datetime时间格式化去掉前导0

Python ZipFile模块详解

python异步任务队列示例

python encode和decode的妙用

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

python 图片验证码代码分享

Python 元组(Tuple)操作详解

精品推荐
分类导航