Python Compiler
import math num = 121; copyNum = num; reverse = 0; #reverse a number while(copyNum != 0): reverse = reverse * 10; reverse = reverse + (copyNum % 10); copyNum = math.floor(copyNum / 10); if(num == reverse): print("%d is a palindrome number" % num) else: print("%d is not a palindrome number" % num)
OUTPUT
121 is a palindrome number
×

Save as Private