{"id":24707,"date":"2021-11-02T09:43:57","date_gmt":"2021-11-02T04:13:57","guid":{"rendered":"https:\/\/python-programs.com\/?p=24707"},"modified":"2021-11-05T17:21:02","modified_gmt":"2021-11-05T11:51:02","slug":"python-list-pop-method-with-examples","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-list-pop-method-with-examples\/","title":{"rendered":"Python List pop() Method with Examples"},"content":{"rendered":"

In the previous article, we have discussed Python List insert() Method with Examples<\/a>
\nList in Python:<\/strong><\/p>\n

Lists in Python are mutable sequences. They are extremely similar to tuples, except they do not have immutability constraints. Lists are often used to store collections of homogeneous things, but there is nothing stopping you from storing collections of heterogeneous items as well.<\/p>\n

List pop() Method in Python:<\/strong><\/p>\n

The pop() method removes the item at the specified index from the list and returns the item that was removed.<\/p>\n

Note:<\/strong> By default, it removes the last element from the list.<\/p>\n

Syntax:<\/strong><\/p>\n

list.pop(index)<\/pre>\n

Parameters<\/strong><\/p>\n

The pop() method only accepts one argument (index).<\/p>\n

index: <\/strong>This is optional.<\/p>\n