Programming Pandit

c/c++/c#/Javav/Python


Latest Update

Tuesday, November 17, 2020

Python Program to check a number whether it is palindrome or not by G Krishna Chauhan

Source Code


num=int(input("Enter a number : ")) 

n=num res=0 

while num>0: 

    rem=num%10 

     res=rem+res*10 

     num=num//10 

if res==n:

    print("Number is Palindrome")

else:

print("Number is not Palindrome")  




OUTPUT


Enter a number : 1221

Number is Palindrome 

No comments:

Post a Comment