You can use Python in-built method del() to remove an element from a list by index as shown in the below example –
1 2 3 4 5 6 7 |
l = [0,1,2,3,4,5,6,7,8,9] del l[-1] ## removes the last element del l[5] ## removes the 5th element del l[0] ## removes the 1st element print(l) ## Returns [1, 2, 3, 4, 6, 7, 8] |