this is my code :
a=[1,0,None,3]
def b(my_list):
for i in range(len(my_list)):
if not my_list[i]:
a.remove(my_list[i])
else:
do_something()
return my_list
a = b(a)
print a
and the error is :
Traceback (most recent call last):
File "c.py", line 18, in <module>
a = b(a)
File "c.py", line 12, in b
if not my_list[i]:
IndexError: list index out of range
so what can i do ,
thanks
do_something()take list element as input?