Create Dictionary: info = {
"Age": 18,
"Name": "Zhangsan",
"Li": [11,[], (), 22,33,{"K1": "Vv1", "Sex": 0}],
}
(1) The keys of a dictionary can be numbers, strings, tuples, keys cannot be duplicated, otherwise the second key cannot be displayed
(2) Value: info[' age ', Info.get ("age", default): value does not exist with default padding
Difference: info["age" key does not exist then error, get () will not
(3) Clear (), Empty dictionary
(4) copy (), Duplicate dictionary (light copy)
(5) del Info[keys], delete the dictionary element by key
(6) for item in info: Loop to get Key,item as info key
(7) for item in Info.keys (): Loop to get keys
(8) for item in Info.values (): Loop to get value
(9) for k,v in Info.item (): Loop to get key and value
(x) v = dict.fromkeys (list, value), generating a dictionary as a value based on each element of the sequence list as a key,value
(one) Pop (key), delete the element key is key, and return the deleted element
() Popitem (), random Delete, and return key, value key value pair
() SetDefault (key, value), set the value. Key already exists, does not set, returns the current key value, key does not exist set key, value, and returns value
Update ({key1:value1, key2:value2})
or update (key1=value1, key2=value2) to update value values
Dict (dictionary)