Programming Examples

Python program that reverse the list of integers in place


Write a Python program that reverse a list of integers (in place)

Solution

mylist=eval(input("Enter any List"))
print("Before Reverse list is ",mylist)
mylist.reverse()
print("After Replace list is ",mylist)
Output

Enter any List[5,7,8,9]

Before Reverse list is  [5, 7, 8, 9]

After Replace list is  [9, 8, 7, 5]

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad