List:
1. an orderly set;
2. Index by the offset to read the data;
3. Support nesting;
4. Variable type;
List of actions:
1. Slices:
A = [1,2,3,4,5,6,7]
Forward Index
Reverse Index
Default Index
2. Add an action
1) + Generate a new list;
2) Extend accepts the parameter and adds each element of the parameter to the original list, modifying the list at the original address instead of creating a new list.
3) Append: Add any object to the end of the list;
4) Insert: Inserts any object into the list, you can control the insertion position.
3. Modifications
Modifying the list itself requires only the direct assignment of the action.
4. Delete operation
1) Del: Deletes the element at the specified location by index.
2) Remove: Removes the first matching value from the specified value in the list. If it is not found, an exception is thrown.
3) Pop: Returns the last element and removes it from the list.
5. Member relations
1) in No in: Determines whether an element exists in the list. Returns a bool type in which the element returns true in the list, otherwise returns false
6. Sort/Reverse
1) Sort/reverse are directly modified on the original list, their return value is none.
Python basic data structure--list