Ad
Code
Diff
  • def is_palindrome(s: str) -> bool:
        temp = ''.join(x for x in s if x.isalpha()).lower()
        return temp[::-1] == temp
    • def is_palindrome(s: str) -> bool:
    • return (x := [*map(lambda z: z.lower(),filter(lambda y: y.isalpha(),[*s]))]) == x[::-1]
    • temp = ''.join(x for x in s if x.isalpha()).lower()
    • return temp[::-1] == temp
Code
Diff
  • def is_palindrome(s: str) -> bool:
        return s == s[::-1]
    • def is_palindrome(s: str) -> bool:
    • s = [c for c in s.lower() if c.isalpha()]
    • return s == s[::-1]