Next Index Previous

Python Examples

7. Program to check whether the given number is palindrom or not.

def palindrom(n):
	num = n
	r = 0
	rev = 0

	while n>0:
		r = n%10
		n = n//10
		rev = (rev*10)+r
		
	if num==rev:
		print('Palindrom')
	else:
		print('Not Palindrom')
		
palindrom(343)		
Output :
Palindrom



Father of Python Language

Guido-van-Rossum

Guido van Rossum

Born: January 31, 1956, Netherlands
Google+