pop()
function or method is used in python list to remove and return the item at the specified index.
list.pop(index)
Here,
>>> list1 = [1, 2, 3]
>>> list1.pop()
3
>>> list1
[1, 2]
>>> list1 = [1, 2, 3]
>>> list1.pop(1)
2
>>> list1
[1, 3]