Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Remove an item from list in Python

In python pop method can used to remove the item from the list. By default using pop method on the list removes the last item of the list and returns the item.

Pop method takes an optional argument which can be used to remove any element from the list and return the element.
cars = ["Mercedes Benz","Honda","Audi", "Volkswagen"]

cars.pop(2)

cars.pop()

cars


Output
'Audi'
'Volkswagen'
['Mercedes Benz', 'Honda']


Note : Pop mutates the existing list