dict Shallow copy ,dict_data1 and dict_data2 The two are independent , But the elements inside point to the same ( It's like a person working in two places ), So whether it's 1 still 2, As long as there is one that changes the element , The other will change with it .( It is similar to this person who was injured at the first place of work , I can only come to the second place of work with injuries ).
dict Deep copy, full copy ( Similar to two twins , Looks exactly the same , But two individuals ), They are completely independent , How to change one of them , The other will not change ( Even if one had an accident , Less organs , The other is still a perfect person without change ).
list In a shallow copy list_data and list_data2 Is two independent bodies , The outermost layer of the list changes , The other doesn't change ; The innermost layer of the list changes , The other will change accordingly .
list Deep copy list_data and list_data2 It's two separate individuals , No matter how the elements inside change , The other doesn't change .
Insert key with a value of default if key is not in the dictionary.
If it's not in the dictionary , Then insert the key with the default value .
update([E, ]**F)-> None. Update D from dict/iterable E and F.
From the dictionary / Can the iteration E and F to update D.
ps: This warning is to remind me that these two can be combined into a new dictionary
get and .setdefault Can pass through nonexistent key Get value , Don't complain ( The output value is None)
Add elements to the collection
Delete and return the first element
If the element is a member , Delete the element from the collection
Remove all elements of another group from this collection .