inverted for python
for i in reversed(range(5)):
print(i)
inverted for python
for i in reversed(range(5)):
print(i)
loop through list backwards python
for item in my_list[::-1]:
print item
python iterate backwards through list
>>> a = ["foo", "bar", "baz"]
>>> for i in reversed(a):
... print(i)
...
or
>>> for i, e in reversed(list(enumerate(a))):
... print(i, e)
iterate backwards through a list python
a = ["foo","bar","baz"]
for i in range(len(a)-1,-1,-1):
print(a[i])
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us