# do like this: def is_palindrome(num): snum = str(num) i = 0 while i < len(snum) - 1 - i: if snum[i] != snum[len(snum) - 1 - i]: return False i += 1 return True #or below def is_palindrome_simple(num): snum = str(num) return snum == snum[::-1]
Sign in to make a reply
在路上Ce