def is_palindrome_num(n):
    if n < 0:
        return False

    temp = n
    rev = 0

    while temp > 0:
        rev = rev * 10 + temp % 10
        temp = temp // 10

    if n == rev:
        return True
    else:
        return False

n = 121
ret = is_palindrome_num(n)
print(ret)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: