l = list(range(10))for i in l: print i try: del l[i] except (RuntimeError,IndexError), e: print e print l
Standard input is empty
0 2 4 5 7 list assignment index out of range 9 list assignment index out of range [1, 2, 4, 5, 7, 9]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!