Answer:
def is_palindrome(s):
# Remove spaces and punctuation, and convert to lowercase
s = ''.join(e for e in s if e.isalnum()).lower()
# Compare the original string with its reverse
return s == s[::-1]
# Test cases
print(is_palindrome("A man, a plan, a canal, Panama")) # True
print(is_palindrome("race car")) # True
print(is_palindrome("hello")) # False