Strings and text · Python exercise
Read a line of text and remove every space character while keeping other punctuation.
Read one line of text and print it with all space characters removed. Other whitespace and punctuation stay unchanged.
Example 1
Input
hello world
Output
helloworld
Example 2
Input
a b c
Output
abc
How testing works
Your code runs once per test case with that case's standard input. Output is compared after normalising trailing spaces and blank lines at the end. Use input() without a prompt when the exercise expects clean output.
Loading editor…
Press Run tests to execute your code against every input case. Python runs in a Web Worker in your browser.