← Back to challenges

Recursion: Palindrome Phrase

PythonHardrecursionstringsvalidationlogic

Instructions

A palindrome is a series of letters or numbers that reads equivocally backwards. Write a recursive function that determines whether a given string is a palindrome or not.

Examples

is_palindrome("Go hang a salami, I'm a lasagna hog!") ➞ True

is_palindrome("This phrase, surely, is not a palindrome!") ➞ False

is_palindrome("Eva, can I see bees in a cave?") ➞ True

Notes

  • Symbols and special characters should be ignored.
  • You are expected to solve this challenge via recursion.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.