Reverse the sequence of a list, and print each item:
alph = ["a", "b", "c", "d"]
ralph = reversed(alph)
for x in ralph:
print(x)
The reversed()
function returns a reversed iterator object.
The iter() function returns an iterator object.
The list.reverse() method reverses a List.
Track your progress - it's free!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4