def is_palindrome(n): L = [str(x) for x in range(2, n)] def is_p(s): l = len(s) flag = True for i in range(l//2): if s[i]!=s[l-i-1]: flag = False break return flag print(list(filter(is_p,L))) is_palindrome(1000)
Sign in to make a reply
diasarah