pop object python code example
Example 1: pop list python
#pop removes the last element
li=[1,2,3,4,5]
li.pop()
#>>>[1, 2, 3, 4]
Example 2: pop python
liste = ['a',1,2]
element = liste.pop()
=> element = 2
=> liste = ['a',1]
liste.pop(0)
=> element = 'a'
=> liste = [1]