第一次发作业,请大家指教啦。
def is_palindrome(n): x = n x = str(x) x = x[::-1] x = int(x) return n == x output = filter(is_palindrome, range(1, 1000000)) print(list(output))
Sign in to make a reply
隔壁过来的
第一次发作业,请大家指教啦。