Python List/Array Methods

MethodDescription
append(x)Adds an element x to the end of the list.
extend(iterable)Appends elements from an iterable to the list.
insert(i, x)Inserts element x at position i in the list.
remove(x)Removes the first occurrence of element x from the list.
pop(i)Removes and returns the element at index i.
index(x)Returns the index of the first occurrence of element x.
count(x)Returns the number of occurrences of element x in the list.
sort()Sorts the list in ascending order.
reverse()Reverses the order of elements in the list.
copy()Returns a shallow copy of the list.
clear()Removes all elements from the list.
len()Returns the number of elements in the list.
max()Returns the maximum element in the list.
min()Returns the minimum element in the list.
sum()Returns the sum of all elements in the list.