def is_palindrome(n): f=str(n) x=0 a=True while(x<len(f)): if (f[x]!=f[-x-1]): a=False x=x+1 return a output = filter(is_palindrome, range(1, 100000)) print(list(output))
Sign in to make a reply
Nemo尼谟