Exercise: Palindromes

"Is it a palindrome?" is a classic warm-up question. The interviewer usually adds a rule after your first answer, such as "ignore case" or "ignore spaces".

You have what you need: lower, replace and slicing with [::-1].

Exercise: finish is_palindrome. It returns True if text reads the same forwards and backwards when you ignore upper and lower case and spaces. "Never odd or even" is a palindrome. "Python" is not. An empty string counts as a palindrome.

Later, in the Algorithms challenges, you will meet the two-pointer version that uses no extra memory.

Press Check to run the tests.