def is_palindrome(n): l1 = [str(s) for s in n] l2 = list(filter(judge, l1)) l3 = [int(s) for s in l2] return l3
def judge(n): return n[0:] == n[::-1]
print(is_palindrome([123,243,232,4567654,3553,98766789,21312421]))
Sign in to make a reply
惟莉V雅爱
def is_palindrome(n): l1 = [str(s) for s in n] l2 = list(filter(judge, l1)) l3 = [int(s) for s in l2] return l3
def judge(n): return n[0:] == n[::-1]
print(is_palindrome([123,243,232,4567654,3553,98766789,21312421]))