# -*- coding: utf-8 -*- def is_palindrome(n): L2 = list(str(n)) L2.reverse() return list(str(n)) == L2 #n为逐个元素 output = filter(is_palindrome, range(1, 1000)) print(list(output))
Sign in to make a reply
水蔓姐姐