def palindrome(n): L=list(str(n)) a=0 while a<(len(L))//2: if L[a]!=L[-a-1]: return False a=a+1 return True
output = filter(palindrome, range(1,1000)) print(list(output))
Sign in to make a reply
报三春晖
def palindrome(n): L=list(str(n)) a=0 while a<(len(L))//2: if L[a]!=L[-a-1]: return False a=a+1 return True
output = filter(palindrome, range(1,1000)) print(list(output))