python tips:dict的key顺序,,python3.6+
python tips:dict的key顺序,,python3.6+
python3.6+版本中,dict的键值保持插入有序。
1 t = list(range(10))2 b = t[:]3 d = dict(zip(t, b))4 print(list(d.items()))
输出结果
1 [(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9)]
python tips:dict的key顺序
相关内容
- arcpy arcgis python实例教程--原点夹角距离定义线(坐标正
- Python,while循环小例子--猜拳游戏(三局二胜),,Python,whi
- 用Python写Roboot Framework测试九:用Python写Roboot Framework测
- python3 面向对象之封装,,封装是是面向的特点之
- Windows安装Python3,,下载1.官网下载需要
- python之字符串中有关%d,%2d,%02d的问题,,在python中,通
- python3 笔记,,.1# 数的定义:#
- python-字符串的处理,,s1 = ‘###1
- Python读取文件编码解码问题,,用chardet检测
- Python的程序结构[3] -> 变量/Variable -> LEGB 法则
评论关闭