Home >>Python List Methods >Python List pop() Method

Python List pop() Method

Python List pop() Method

Python list pop() method is used to remove the element at the specified position in the given input list.

Syntax:
list.pop(pos)

Parameter Values

Parameter Description
pos This is an optional parameter. It defines a number specifying the position of the element you want to remove.
Here is an example of Python pop() method:

a = ['Abhi', 'Mike', 'Jerry']
a.pop(1)
print(a)

Output:
['Abhi', 'Jerry']
Example 2:

a = ['Abhi', 'Mike', 'Jerry']
a.pop()
print(a)

Output:
['Abhi', 'Mike']

No Sidebar ads