check if number is palindrome

Question

n=int(input(“Enter a number:”))
t=n
r=0
while(n>0):
d=n%10
r=r*10+d
n=n//10
if(t==r):
print(“Palindrome”)
else:
print(“Not a Palindrome”)

0
YashikaKhurana 55 years 0 Answers 728 views Master 0

Leave an answer

Browse
Browse