DS160123 Today's Question for Python Preparation

to Check if a Number is a Palindrome or not.

num=int(input(“Enter number:”))
x=num
rev=0
while(num>0):
dig=num%10
rev=rev*10+dig
num=num//10
if(x==rev):
print(“The number is a palindrome!”)
else:
print(“The number is not a palindrome!”)

1 Like

@prasannpatil18

Well done.keep it up.

1 Like