Objective
Create a Python program that turns a sentence into a hyphen-joined string and counts its words.
Instructions
- Read a sentence whose words are separated by a single space.
- On the first line show the sentence with the spaces replaced by hyphens (
-). - On the second line show the number of words.
aprender python es divertido
aprender-python-es-divertido
4
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise