daily pastebin goal
49%
SHARE
TWEET

snipplet

a guest May 14th, 2012 31 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. >>> l = range(10)
  2. >>> for i in l:
  3. ...     if i % 2:
  4. ...             del l[i]
  5. ...
  6. Traceback (most recent call last):
  7.   File "<stdin>", line 3, in <module>
  8. IndexError: list assignment index out of range
  9. >>> l
  10. [0, 2, 3, 5, 6, 8, 9]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top