I am tryin to delete an item from a list by specifying the index of the list I want to delete but I get an error.
My code:
tuu = [1,2,3,4,'nan', 8]
for i in range(len(tuu)):
if tuu[i] == 'nan':
del tuu[i]
but I get the error:
7 for i in range(len(tuu)):
----> 8 if tuu[i] == 'nan':
9 del tuu[i]
IndexError: list index out of range