Palindrome – Python




num=int(input("Enter a number: "))
temp = num
rev = 0
while(num > 0 ):
dig = num%10
rev=rev*10+dig
num=num//10
if(temp==rev):
print("Palindrome")
else:
print("Non - Palindrome")
    Indentation Error: The error prompted when there is a unnecessary division or there is a different pattern proceeding.

IndentationError: expected an indented block

Scroll to top