Functions · 21 / 27 Exercise Medium

Function to check palindrome

Objective

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

Instructions

  • In the main function, ask the user for a text.
  • Implement the function is_palindrome() with the text as a parameter. It returns True if the text is a palindrome and False if it is not.
  • 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