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]

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials 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 Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz