Write a function to check if a given string is a palindrome (reads the same forward and backward) while ignoring spaces, punctuation, and character case. Return `True` if it's a palindrome, `False` if it's not. Example: Input: "A man, a plan, a canal, Panama" Output: True Input: "hello" Output: False
Anonymous
import re def is_palindrome(s): s = re.sub(r'[^a-zA-Z0-9]', '', s).lower() return s == s[::-1]
Check out your Company Bowl for anonymous work chats.