Text processing · 10 / 14 Exercise Medium

Palindromes

Objective

Create a Python program that checks whether a sentence is a palindrome, that is, whether it reads the same from left to right as from right to left.

Instructions

  • Read a sentence. It contains no accented letters.
  • Ignore capital letters, spaces and punctuation marks: keep only the letters and numbers, in lower case (isalnum()).
  • Compare the result with its reverse ([::-1]).
  • Show Palindrome or Not a palindrome.
Input
Anita lava la tina
Output
Palindrome

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

Start exercise