fork download
  1. n=int(input("enter the number :"))
  2. rev=0
  3. temp=n
  4. while n>0:
  5. num=n%10
  6. rev=rev*10+num
  7. n=n//10
  8. if temp==rev:
  9. print("palindrome")
  10. else:
  11. print("not palindrome")
  12.  
Success #stdin #stdout 0.06s 63308KB
stdin
45
stdout
enter the number :not palindrome