Palindrome number check in python programming


#Alamgir Hossain, CSE, JUST
#Palindrome number check in python----------
num = input("Enter the number : ")

n = num

sum = 0  #Declare sum = 0
while num>0:
    remainder = num%10    sum = remainder + (sum*10)
    num = num/10
#print sum
#print n
if sum == n:
    print "The entered number is palindrome."else:
    print "The number is not palindrome."

No comments:

Post a Comment