fork download
  1. l = list(range(10))
  2. for i in l:
  3. print i
  4. try:
  5. del l[i]
  6. except (RuntimeError,IndexError), e:
  7. print e
  8.  
  9. print l
Success #stdin #stdout 0.03s 6356KB
stdin
Standard input is empty
stdout
0
2
4
5
7
list assignment index out of range
9
list assignment index out of range
[1, 2, 4, 5, 7, 9]