創建空字典,然后往里面填充
\>>> t={}
\>>> t={"name":"tom","age":"22"}
\>>> t
{'name': 'tom', 'age': '22'}
\>>>
利用元組構建字典
\>>> n=(\["name","tom"\],\["age","22"\]) \#創建并賦值 名為n的元組
\>>> m=dict(n)
\>>> m
{'name': 'tom', 'age': '22'}
fromkeys: #一個鍵可對應多個值
\>>> a={}.fromkeys(("third","forth"),"facebook")
\>>> a
{'third': 'facebook', 'forth': 'facebook'}
\>>>