Recursion · 11 / 18 Exercise Medium

Check palindrome recursively

Objective

Create a Python program with a recursive function that checks whether a text is a palindrome. A palindrome is a text that reads the same backwards and forwards, like the word *radar*.

Instructions

  • Ask the user for a text.
  • Implement a recursive function called is_palindrome that receives the text and checks whether it is a palindrome. It returns True if it is and False otherwise.
  • Print the value returned by the function.
Input
radar
Output
True

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise