12. Problem to print the list in reverse order using for loop

In this program, we will take a user input as a list & print the list in reverse order using for loop with the help of the below-given steps.

List in reverse order:

Steps to solve the program
  1. Take a list as input.
  2. Using for loop with range() function print the given list in the reverse order.
				
					#Input list
list1 = [1,2,3,4,55]

#Printing list in the reverse order
#Using for loop
for i in range(len(list1)-1,-1,-1):
    print(list1[i], end=" ")
				
			

Output :

				
					55 4 3 2 1
				
			

Related Articles

Common elements from two lists

List in the reverse order using while loop

Leave a Comment