Palindrome Check
Completed
Read a phrase. Ignoring case, spaces and punctuation, print YES if it reads the same forwards and backwards, otherwise NO.
Input
One line.
Output
YES or NO
Example
Input
A man, a plan, a canal: Panama
Output
YES
Editor
Python
Hints
Keep only characters where ch.isalnum() is True.
Compare the cleaned text with its reverse.
Solution explanation
A generator expression inside "".join(...) builds the cleaned string in one line.
Show solution
text = input()
cleaned = "".join(ch.lower() for ch in text if ch.isalnum())
print("YES" if cleaned == cleaned[::-1] else "NO")