Python sequence, Dictionary memo, and python dictionary memo
Python memo:
Sequence: List, string, and tuples
Len (d), d [id], del d [id], data in d
Function:
Cmp (x, y ),
Len (seq ),
List (seq) creates a list based on strings,
Max (args ),
Min (args ),
Reversed (seq ),
Sorted (seq ),
Tuple (seq)
List Method:
Add an object at the end of append,
Count () object count,
Add a list at the end of extend,
Index () the location of the First Matching object,
Insert () inserts an object, pop () removes an object,
The default value is the end. remove () removes the first matched object,
Reverse storage of reverse,
Sort () List sorting does not return,
Sorted () returns the sorting list, but this list remains unchanged.
Tuples: The tuples cannot be modified.
The tuple () parameter is a sequence or tuples that return tuples.
String: All strings are unchangeable.
Find () method, query string, no-1 is returned, and a cursor is returned
Join () method, add element, return the string of the added element
Lower () method, returns the lower-case version of the string
The replace () method returns the string that matches the string after replacement.
Split () method, string segmentation into sequences, inverse join method
Dictionary:
Len (d), d [id], del d [id], data in d
Method:
Copy () to copy the content. If you copy the content directly (a = B), it is actually the copy of the address, pointing to the same address.
Fromkeys ([], []) uses the specified key value to initialize the dictionary. Parameter 1 is the sequence of key values, and parameter 2 is the initial value. The default value is none.
The get (key) method to access the dictionary. No error will be reported if no member is needed,
Has_key () is equivalent to key in d
Items () returns all dictionaries to the list
Keys () returns all the keys as a list
Pop () removes the key-value corresponding to the key value
Popitem () returns a random item removed
Setdefault (key, data) has the same get (), and no random key value can be set
Z. update (y) Updates another dictionary using one dictionary and updates z using y
Values () returns the value in the dictionary in the form of a list