I have this simple code
all_rooms
have 20+ elements
del all_rooms[0]
del all_rooms[1]
for everyRoom in all_rooms:
print(everyRoom)
I get this error
del all_rooms[0]
IndexError: list assignment index out of range
I just want to remove the 0
th and 1
st index from list.
I saw an answer from here on SO
I can print my list elements easily if I comment out del
statements