CJCoding With Joseph
15free / daySign inCreate account

Palindrome Ignoring Spaces

Read one phrase in lower case and decide whether it is a palindrome once every space is ignored: print exactly Palindrome or exactly Not a palindrome. First build cleaned by looping over the phrase and adding only the characters that are not a space (!= tests for not equal), then compare the cleaned string with its reverse made by the slice [::-1]. Input: one line, the phrase, no prompt; it may contain spaces anywhere.

Expected Output:

Palindrome

= newline. The output ends with a newline — print one after the last line.

Hints4 available
Topics:
StringsSlicing
📥 Auto-Input:
never odd or even\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.