Palindrome check
Read a line and print Yes if it is a palindrome or No if it is not.
Ignore capital letters, spaces and punctuation, so A man, a plan, a canal: Panama is a palindrome.
Input
racecar
Expected output
Yes
Input
A man, a plan, a canal: Panama
Expected output
Yes
Show a hint
Build a cleaned string with only letters and digits (str.isalnum()), in lower case, then compare it with its reverse.
Show a solution
Loading the editor…
Run the tests to check your solution.