Programming Examples
Python program to input any number and to find reverse of that number
Write a program to input any number and to find reverse of that number.
Solution
num = int(input("Enter any number"))
rev = 0
while(num>0):
digit=num%10
rev = rev*10+digit
num = num//10
print ("reverse number is", r)
Output/ Explanation:
Enter any number 345
reverse number is 543