python 数组删除 python dict remove数组删除(del,pop)

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

python 数组删除 python dict remove数组删除(del,pop)

  2021-03-18 我要评论
想了解python dict remove数组删除(del,pop)的相关内容吗,在本文为您仔细讲解python 数组删除的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:数组,下面大家一起来学习吧。
比如代码

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}

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们