File size: 162 Bytes
91f7972
 
58f6308
 
1
2
3
4
5
def is_palindrome(s):
    """Check if a string is a palindrome."""
    cleaned = "".join(c.lower() for c in s if c.isalnum())
    return cleaned == cleaned[::-1]