python list pop by index code example
Example 1: python pop element
my_list = [123, 'Add', 'Grepper', 'Answer']
my_list.pop()
-->[123, 'Add', 'Grepper']
my_list = [123, 'Add', 'Grepper', 'Answer']
my_list.pop(0)
-->['Add', 'Grepper', 'Answer']
my_list = [123, 'Add', 'Grepper', 'Answer']
any_index_of_the_list = 2
my_list.pop(any_index_of_the_list)
-->[123, 'Add', 'Answer']
Example 2: how to remove element from list python by index
>>> l = [1, 2, 43, 3, 4]
>>> l.pop(2)
43
>>> l
[1, 2, 3, 4]
Example 3: drop an intex in a list python
listOfnum.remove()