Skip to content

Instantly share code, notes, and snippets.

@bergpb
Created April 16, 2019 01:29
Show Gist options
  • Select an option

  • Save bergpb/56c66f25c8b0806ecbe2f8f99bbb6bbf to your computer and use it in GitHub Desktop.

Select an option

Save bergpb/56c66f25c8b0806ecbe2f8f99bbb6bbf to your computer and use it in GitHub Desktop.
Uso de enumerate para retornar o índice dos itens de uma lista
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