Python Practice Lab
easyUnit 3 · Strings

P7. Palindrome Checker

Strings

A palindrome reads the same forwards and backwards. Read a line of text, keep only its letters and digits, convert it to lowercase, and check whether the result is a palindrome.

Input Format

  • Line 1: a line of text

Output Format

  • Line 1: Cleaned: <cleaned text>
  • Line 2: Palindrome or Not a palindrome

Constraints

  • 1 ≤ length of the text ≤ 200
  • The text contains at least one letter or digit

Sample Test Cases

Sample 1
Input
Madam
Output
Cleaned: madam
Palindrome
Sample 2
Input
A man, a plan, a canal: Panama
Output
Cleaned: amanaplanacanalpanama
Palindrome

Submitting checks 2 sample cases and 4 hidden test cases.

Hints

Saved
Custom 1

This is your own input, so Run will show what your program prints but can't say whether it's correct.