Advertisement
asweigart

Untitled

Oct 24th, 2016
552
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. >>> spam = ['dog', 'cat', 'bat', 'mouse']
  2. >>> spam
  3. ['dog', 'cat', 'bat', 'mouse']
  4. >>> for i in range(len(spam)): print(i, spam[i])
  5. ...
  6. 0 dog
  7. 1 cat
  8. 2 bat
  9. 3 mouse
  10. >>> for index, value in enumerate(spam): print(index, value)
  11. ...
  12. 0 dog
  13. 1 cat
  14. 2 bat
  15. 3 mouse
  16. >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement