Python List pop() Method

  • Post category:List

The pop() method removes the item at the given index from the list and returns the removed item.

In this blog post, you will learn how to use the python list pop() method.

Step 1: Create a list

my_list = [1, 2, 3, 4, 5]

Step 2: Pop the list

print(my_list.pop(3))

Step 3: Print the new list

print(my_list)

Output:

4