# Basic syntax:
range(start, stop, -1) # or:
reversed(range(stop))
# Note, the stop value is not inclusive with range()
# Example usage:
for i in range(5, 0, -1):
print(i)
# prints:
5
4
3
2
1
for i in reversed(range(5)):
print(i)
# Output :-
# 5
# 4
# 3
# 2
# 1
# 0
for i in range(5, 0, -1):
print{i)
5
4
3
2
1
range(200)[::-1]
# Basic syntax:
range(start, stop, -1) # or:
reversed(range(stop))
# Note, the stop value is not inclusive with range()
# Example usage:
for i in range(5, 0, -1):
print(i)
# prints:
5
4
3
2
1
for i in reversed(range(5)):
print(i)
# Output :-
# 5
# 4
# 3
# 2
# 1
# 0
for i in range(5, 0, -1):
print{i)
5
4
3
2
1
range(200)[::-1]