tang={key1:123,key2:456}
tang2={key2:789,key3=886}
tang.update(tang2)
tang.keys()
tang.values()
tang.items()
tang={key1:123,key2:456}
tang2={key2:789,key3=886}
tang.update(tang2)
tang.keys()
tang.values()
tang.items()
P字典数值类型
字典结构嵌套
dict={}
d1={'w1':123,'W2':345,'w3':789}
d2={'W4':012}
dict['t1']=d1
dict['t2']=d2
嵌套赋值
+
dict.get('sth','meiyou')
dict.pop()
del dict['sth']
dict={'sth1':123,'sth2':456}
dict2={'sth1':789,'sth4':000}
dict.update(dict2)更新dict,基于dict2
'sth' in dict 是否存在
dict.keys()打印键值
dict.values()