Python list.pop() Method
The pop() method removes the element at the specified position.
Syntax
list.pop(pos)
Parameters
| Parameter | Description |
|---|---|
pos |
Optional. A number specifying the position of the element you want to remove, default value is -1, which returns the last item |
Return Value
The removed value.
Example
Using the pop() method:
Output
Click Run to execute your code
Enjoying these tutorials?