Discuss / Python / 练习

练习

Topic source

JeromeDeng

#1 Created at ... [Delete] [Delete and Lock User]

def is_palindrome(n): if n is None: return False s = str(n) revs = s[::-1] return s == revs

output = filter(is_palindrome, range(1, 1000)) print(list(output))


  • 1

Reply