python---dictionary
来源:互联网 发布:linux数据库启动命令 编辑:程序博客网 时间:2024/06/17 09:07
定义:{key1:value1,key2:value2},key-value结构,key必须可hash
特性:
1.可存放多个值
2.可修改指定key对应的值,可变
特性:
1.可存放多个值
2.可修改指定key对应的值,可变
3.无序
==========================================================
dict.['a']=1 dict={'a':1}
1、radiansdict.clear():删除字典内所有元素
2、radiansdict.copy():返回一个字典的浅复制
3、radiansdict.fromkeys():创建一个新字典,以序列seq中元素做字典的键,val为字典所有键对应的初始值
4、radiansdict.get(key, default=None):返回指定键的值,如果值不在字典中返回default值
5、
6、radiansdict.items():以列表返回可遍历的(键, 值) 元组数组
7、radiansdict.keys():以列表返回一个字典所有的键
8、radiansdict.setdefault(key, default=None):和get()类似, 但如果键不已经存在于字典中,将会添加键并将值设为default
9、radiansdict.update(dict2):把字典dict2的键/值对更新到dict里
10、radiansdict.values():以列表返回字典中的所有值
阅读全文
0 0
- python Dictionary
- python Dictionary
- Python Dictionary
- Python Dictionary
- python dictionary
- python dictionary
- python---dictionary
- 开始Python -- Dictionary
- python : Sorting a Dictionary
- python两个dictionary合并
- Python Dictionary and List
- Learning Python(6) Dictionary
- python dictionary get getlist
- Python dictionary 字典
- python Dictionary字典使用
- dictionary的例子 python
- Python dictionary items() Method
- Python: The Dictionary Playbook
- js中引用类型之日期
- ArcEngine 图层标注 (根据字段、角度)
- error C4996: 'sprintf': This function or variable may be unsafe 解决方法
- python爬虫获取淘宝妹子信息和相片
- Android解决UnsupportedOperationException异常!
- python---dictionary
- 517.Super Washing Machines
- 温故而知新系列:Java反射机制详解
- 贝塞尔曲线原理及应用
- 6.12-6.14 JLL--实习日志--filetype-change功能 !+js不工作+js函数嵌套使用
- Azure deploy with git
- 单反相机自带云台螺丝大部分是1/4的
- 监听器监听日志,实时读取日志文件,把读取到的数据入库
- 【Unity】FBX和Prefab 同名造成的问题