Skip to content

Instantly share code, notes, and snippets.

@eyaltrabelsi
Last active July 17, 2019 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eyaltrabelsi/77de3e696a5210a616af480719e90e59 to your computer and use it in GitHub Desktop.
Save eyaltrabelsi/77de3e696a5210a616af480719e90e59 to your computer and use it in GitHub Desktop.
Python tricks terating over list index and value pairs
>>> a = ['Hello', 'world', '!']
>>> list(enumerate(a))
[(0, 'Hello'), (1, 'world'), (2, '!')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment