Skip to Main Content

Palindrome Number

Problem URL:Palindrome Number

My Solution

Python

def isPalindrome(x: int) -> bool:
    num_str = str(x)
    if x < 0 or num_str != num_str[::-1]:
        return False
    else:
        return True

Let's Connect

Twitter GitHub LinkedIn