# -*- coding: utf-8 -*- def is_palindrome(n): m = '%d'%n L = list(m) i = 0 while i < (len(L)-i): if L[i] == L[len(L)-(i+1)]: i = i + 1 else: return False break return True output = list(filter(is_palindrome, range(1,1000))) print(output)
Sign in to make a reply
东东男装