Loading...
Loading...
Loading...
A badge printer accepts a line of text if its letters and digits read the same forwards and backwards. Ignore spaces, punctuation and capital letters. Print Yes or No.
Example 1
Input
A man, a plan, a canal: Panama
Output
Yes
Only the letters count.
Example 2
Input
hello
Output
No
Try the problem first. Open one hint at a time.
Build a list of the lower-case letters and digits first.
Compare the first and last, then move both ends towards the middle.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor