i
: ( Position ) Position of the element to be removed ( 0 based index )
my_list=['a','b','c','d','e']
my_list.pop(2)
print(my_list)
Output ( element at position 2 , c is removed )
['a', 'b', 'd', 'e']
my_list=['Alex','Ronald','John']
my_list.pop() # deletes last element
print(my_list)
Output is here
['Alex', 'Ronald']
We can remove element from a particular position
my_list=['Alex','Ronald','John']
my_list.pop(0) # deletes first element
print(my_list)
Output is here
['Ronald', 'John']
We can collect the removed element
my_list=['Alex','Ronald','John']
name=my_list.pop(1) # deletes first element
print(name)
Output is here
Ronald
All list methods Questions with solutions on List
clear() to remove all itemsAuthor
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.