The pop method removes an element (by default the last one) from the list and returns it : Pop « List « Python Tutorial






x = [1, 2, 3]
x.pop()
print x
x.pop(0)
print x








7.21.Pop
7.21.1.The pop method removes an element (by default the last one) from the list and returns it
7.21.2.Pop item by index