Objective
Develop a Python program with a function called count_spaces that receives a text and returns the total number of spaces it contains.
Instructions
- Implement the function
count_spaceswith a text parameter. - In the
mainfunction, ask the user for a text. - Call
count_spaceswith the text as an argument. - Print the result, which is the quantity of spaces in the text.
Hello, how are you?
3
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise