Common Python List Methods
Python lists have several built-in methods that allow you to manipulate the lists effectively.
append()
Adds an item to the end of the list.
extend()
Adds all the elements of an iterable to the end of the list.
insert()
Inserts an item at the specified position.
remove()
Removes the first item with the specified value.
pop()
Removes the item at the specified position.
clear()
Removes all the items from the list.
index()
Returns the index of the first element with the specified value.
count()
Returns the number of elements with the specified value.
sort()
Sorts the list.
reverse()
Reverses the order of the list.
copy()
Returns a copy of the list.