Created
March 4, 2020 13:26
-
-
Save RicardoTurco/9227760f00e876355c5b0ead7b61a016 to your computer and use it in GitHub Desktop.
Python: Iterando listas com índice negativo
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
st = list('gooogle') | |
# ['g', 'o', 'o', 'o', 'g', 'l', 'e'] | |
# Estamos iterando a lista "st" na ordem inversa ... | |
for x in range((len(st)-1), (0-1), -1): | |
print(st[x]) | |
# Result | |
e | |
l | |
g | |
o | |
o | |
o | |
g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment