MENU
CLOSE
NOTES
CONTACT
Source: 📖 Python Cookbook ch4.5 p119
Use the reversed() function to iterate over a sequence in reverse order.
reversed()
my_list = [1, 2, 3, 4] for num in reversed(my_lsit): print(num) # 4, 3, 2, 1