Last active
July 17, 2019 18:21
-
-
Save eyaltrabelsi/77de3e696a5210a616af480719e90e59 to your computer and use it in GitHub Desktop.
Python tricks terating over list index and value pairs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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