Palindrome Checker
Easy
25
1
83.8% Acceptance
In this lab, you will create a function named is_palindrome
to determine whether a given string is a palindrome. A palindrome is a word or phrase that reads the same forwards and backwards.
Task
Your task is to implement the is_palindrome
function in Python. It should take a string as input and return:
True
if the string is a palindrome.False
if the string is not a palindrome.None
in the case of an empty string
Examples
is_palindrome("racecar")
should returnTrue
.is_palindrome("codedamn")
should returnFalse
.is_palindrome("No lemon, no melon")
should returnTrue
.is_palindrome("")
should returnNone
.
Notes
- Consider only the alphanumeric characters and ignore case.
- Special characters, spaces, and punctuation should be ignored.
- The function should handle edge cases such as empty strings appropriately.