# Python List Methods (All) with Examples and Outputs
1. **append(x)**
Adds an item to the end.
Example:
a = [1, 2]
[Link](3)
Output: [1, 2, 3]
2. **extend(iterable)**
Adds all elements from another iterable.
Example:
a = [1, 2]
[Link]([3, 4])
Output: [1, 2, 3, 4]
3. **insert(i, x)**
Inserts at index.
Example:
a = [1, 3]
[Link](1, 2)
Output: [1, 2, 3]
4. **remove(x)**
Removes first occurrence of x.
Example:
a = [1, 2, 2, 3]
[Link](2)
Output: [1, 2, 3]
5. **pop(i=-1)**
Removes and returns item at index.
Example:
a = [10, 20, 30]
x = [Link]()
Output: [10, 20] 30
6. **clear()**
Clears the list.
Example:
a = [1, 2, 3]
[Link]()
Output: []
7. **index(x)**
Returns index of the first occurrence.
Example:
a = ['a', 'b', 'c']
Output: 1
8. **count(x)**
Counts occurrences.
Example:
a = [1, 1, 2]
Output: 2
9. **sort()**
Sorts the list.
Example:
a = [3, 1, 2]
[Link]()
Output: [1, 2, 3]
10. **reverse()**
Reverses the list.
Example:
a = [1, 2, 3]
[Link]()
Output: [3, 2, 1]
11. **copy()**
Returns a shallow copy.
Example:
a = [1, 2]
b = [Link]()
Output: [1, 2]