Created
April 16, 2019 01:29
-
-
Save bergpb/56c66f25c8b0806ecbe2f8f99bbb6bbf to your computer and use it in GitHub Desktop.
Uso de enumerate para retornar o índice dos itens de uma lista
This file contains hidden or 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
| In [1]: itens = enumerate([0,1,2,3,4,5]) | |
| In [2]: for i in itens: | |
| ...: print(i) | |
| ...: | |
| (0, 0) | |
| (1, 1) | |
| (2, 2) | |
| (3, 3) | |
| (4, 4) | |
| (5, 5) | |
| In [3]: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment