Loading...
Loading...
Loading...
A review box shows a word count. Words are separated by one or more spaces. Read one line and print the number of words.
Extra spaces at the start, at the end or between words do not create extra words.
Example
Input
fast delivery and great support
Output
5
Try the problem first. Open one hint at a time.
split() with no argument cuts on any run of spaces.
The answer is the length of the list that split() returns.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor