Write code to check whether a number is a palindrome. Implement is_palindrome(x) for an integer input and return a boolean; negative numbers are not palindromes, and leading zeros are not represented. For example, 121 returns True, while -121 and 10 return False; assume -2^31 <= x <= 2^31 - 1.
def is_palindrome(x):