# -*- coding: utf-8 -*- def is_palindrome(n): if n >10: return str(n) == str(n)[::-1] output = filter(is_palindrome, range(1, 1000)) print(list(output))
这樣的写的话,那些个位数的数就不在这个范围内了,但是实际上个位数的数也是回数。
Sign in to make a reply
会点儿pop的王天幸