Chapter 3 python3, python3
Python includes the following functions:
| Serial number |
Function |
Instance |
| 1 |
List. append (obj)
Add a new object at the end of the list |
|
| 2 |
List. count (obj)
Count the number of times an element appears in the list |
|
| 3 |
List. extend (seq)
Append multiple values in another sequence at the end of the list (extend the original list with the new list) |
|
| 4 |
List. index (obj)
Locate the index location of the first matching item of a value from the list |
|
| 5 |
List. insert (index, obj)
Insert objects to the list |
|
| 6 |
List. pop (obj = list [-1])
Removes an element from the list (the last element by default) and returns the value of this element. |
|
| 7 |
List. remove (obj)
Removes the first matching item of a value from the list. |
|
| 8 |
List. reverse ()
Elements in the reverse list |
|
| 9 |
List. sort ([func])
Sort the original list |
|
| 10 |
List. clear ()
Clear list |
|
| 11 |
List. copy ()
Copy list |
|
| 12 |
Len (list)
Number of list elements |
|
| 13 |
Max (list)
Returns the maximum value of the list element. |
|
| 14 |
Min (list)
Returns the minimum value of the list element. |
|
| 15 |
List (seq)
Convert tuples to a list |
|