returns whether num is a palindrome or not see for reference https en wikipedia orgwikipalindromicnumber isintpalindrome121 false isintpalindrome0 true isintpalindrome10 false isintpalindrome11 true isintpalindrome101 true isintpalindrome120 false returns whether num is a palindrome or not see for reference https en wikipedia org wiki palindromic_number is_int_palindrome 121 false is_int_palindrome 0 true is_int_palindrome 10 false is_int_palindrome 11 true is_int_palindrome 101 true is_int_palindrome 120 false
def is_int_palindrome(num: int) -> bool:
    
    if num < 0:
        return False

    num_copy: int = num
    rev_num: int = 0
    while num > 0:
        rev_num = rev_num * 10 + (num % 10)
        num //= 10

    return num_copy == rev_num


if __name__ == "__main__":
    import doctest

    doctest.testmod()