fork download
  1. l = [1,2,3,4,5]
  2.  
  3. for i in range(len(l)):
  4. del l[i]
  5. print(len(l))
  6.  
  7.  
Runtime error #stdin #stdout #stderr 0.02s 9984KB
stdin
Standard input is empty
stdout
4
3
2
stderr
Traceback (most recent call last):
  File "./prog.py", line 4, in <module>
IndexError: list assignment index out of range