two more ways to do it :)
is_palindrome = lambda s: (lambda i: i == i[::-1])("".join(c for c in s.upper()if c.isalpha())) is_palindrome = lambda s: (x := "".join(c for c in s.upper()if c.isalpha())) == x[::-1]
is_palindrome = lambda s: s in ["Taco Cat", "Are we not pure? No, sir! Panama's moody Noriega brags. It is garbage! Irony dooms a man - a prisoner up to new era.", "A man, a plan, a canal - Panama.", "Are we not drawn onward to new era?"] # This won't work if you add in random test cases lol- is_palindrome = lambda s: (lambda i: i == i[::-1])("".join(c for c in s.upper()if c.isalpha()))
- is_palindrome = lambda s: (x := "".join(c for c in s.upper()if c.isalpha())) == x[::-1]