Question:
Swapping first and last digits of the number
We need to swap the first and last digits of the number
For Example:
list1=[]
n= int(input("Enter the number of elements in list:"))
for x in range(0,n):
element=int(input("Enter element" + str(x+1) + ":"))
list1.append(element)
temp=list1[0]
list1[0]=list1[n - 1]
list1[n - 1]=temp
print("New list is:")
print(list1)
---------End---------