Python for Loop Reverse

February 24, 2019
nums = [1, 2, 3, 4, 5]
for value in reversed(nums):
  print(value)
for i in range(len(nums)-1, -1, -1):
  print(nums[i])
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.