Python3.7——字典
字典的添加
import sys
dict={}
dict[1]="one"
dict_new={2:'two',3:'three'}
dict.update(dict_new)
print (dict) #{1: 'one', 2: 'two', 3: 'three'}
print (dict.keys()) #dict_keys([1, 2, 3])
print (dict.values()) #dict_values(['one', 'two', 'three'])
如果你输出的是dict.keys
原创
2021-07-13 11:39:29 ·
146 阅读 ·
0 评论