Solution 1: using reversed() function
number_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for num in reversed(number_list):
print(num)
Output:
9
8
7
6
5
4
3
2
1
Solution 2: using slicing
number_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for num in my_list[::-1]:
print(num)

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!