9. 回文数
方法一
class Solution(object): def isPalindrome(self, x): """ :type x: int :rtype: bool """ if x < 0: return False x = str(x) for i in range(len(x)//2): if x[i] != x[len(x)-i-1]: return False return True
class Solution(object): def isPalindrome(self, x): """ :type x: int :rtype: bool """ if x < 0: return False x = str(x) for i in range(len(x)//2): if x[i] != x[len(x)-i-1]: return False return True