Palindrome Checker

Easy
23
1
83.2% 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

  1. is_palindrome("racecar") should return True.
  2. is_palindrome("codedamn") should return False.
  3. is_palindrome("No lemon, no melon") should return True.
  4. is_palindrome("") should return None.

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.