Given a map of simple integers:
this_map = map(int, input().split())
2 4 1 3 5
How do I print this_map
in reverse order? I can print each item with a simple for loop but printing the thing in reverse format requires indexing and this is not possible through standard procedure.
for item in this_map[::-1]:
print(item)
TypeError: 'map' object is not subscriptable
A similar post on using enumerate()
exists but how do I use it here to add indexes?
Note: I'm using Python 3.6