Discuss / Python / 交作业!!!!!!

交作业!!!!!!

Topic source

def is_palindrome(n): if n > 10: return n % 10 == n // (10 **(len(str(n)) - 1)) output = filter(is_palindrome, range(1, 1000)) print(list(output))

晕,才发现只能用在1000以下。


  • 1

Reply