Python
之判斷判斷回數
def is_palindrome(n):
sum = 0
temp = n
while temp // 10 > 0:
quotient = temp // 10 # 商
remainder = temp % 10 # 餘數
temp = quotient
sum = sum * 10 + remainder * 10
sum += temp
return sum == n