LearnPy Hub
← Strings problems
Hard

Tidy Spaces

Read a line that may have extra spaces. Print it with leading and trailing spaces removed and every group of spaces replaced by one space.

Input

One line.

Output

The tidy line.

Sample 1

Input
  hello    world  
Output
hello world

Sample 2

Input
a  b   c
Output
a b c
solution.py
Output appears here
Tidy Spaces · Python practice problem · LearnPy Hub