def is_palindrome(n): str_n = str(n) len_n = len(str_n) count = 0 while count < len_n : if str_n[count:count+1] != str_n[len_n-count-1:len_n-count] : return False count = count + 1 return True;
感觉有点繁琐。
Sign in to make a reply
goodspb
感觉有点繁琐。