Palindrome
Checks if the given string is a palindrome.
- Use
str.lower()
andre.sub()
to convert to lowercase and remove non-alphanumeric characters from the given string. - Then, compare the new string with its reverse, using slice notation.
Checks if the given string is a palindrome.
str.lower()
and re.sub()
to convert to lowercase and remove non-alphanumeric characters from the given string.