Next Index Previous

Python Examples

3. Program to find reverse number of a given number.

n = int(input('Enter a value'))
r = 0
rev = 0

while n>0:
	r = n%10
	rev = (rev*10)+r
	n = n//10

print('Reverse number = ',rev)
Input :
785
Output :
587



Father of Python Language

Guido-van-Rossum

Guido van Rossum

Born: January 31, 1956, Netherlands
Google+