Cut down the same list into given index
Let's say we have a list
mainList = [3,5,2,7,0,9]
If I remove 3 item
then mainList
should be
[7,0,9]
Is there a way to do that?
Cut down the same list into given index
Let's say we have a list
mainList = [3,5,2,7,0,9]
If I remove 3 item
then mainList
should be
[7,0,9]
Is there a way to do that?
If you want to delete the first n occurences in a list:
mainList = [3,5,2,7,0,9]
for i in range(0,3):
mainList.pop(0)
print(mainList)
Output:
[7, 0, 9]