算法-目录 题目来源: 9. 回文数 class Solution(object): def isPalindrome(self, x): """ :type x: int :rtype: bool """ s = str(x) length = len(s) i=0 while i<length/2: if s[i]!=s[length-i-1]: return False i+=1 return True