Playback Speed
Some people have a habit of lecturing speaking rather quickly, and it’d be nice to slow them down, a la YouTube’s 0.75 playback speed, or even by having them pause between words.
In a file called playback.py, implement a program in Python that prompts the user for input and then outputs that same input, replacing each space with ... (i.e., three periods).
Hints
- Recall that
inputreturns astr, per docs.python.org/3/library/functions.html#input. - Recall that a
strcomes with quite a few methods, per docs.python.org/3/library/stdtypes.html#string-methods.
Demo
Before You Begin
Log into cs50.dev, click on your terminal window, and execute cd by itself. You should find that your terminal window’s prompt resembles the below:
$
Next execute
mkdir playback
to make a folder called playback in your codespace.
Then execute
cd playback
to change directories into that folder. You should now see your terminal prompt as playback/ $. You can now execute
code playback.py
to make a file called playback.py where you’ll write your program.
How to Test
Here’s how to test your code manually:
- Run your program with
python playback.py. TypeThis is CS50and press Enter. Your program should output:This...is...CS50 - Run your program with
python playback.py. TypeThis is our week on functionsand press Enter. Your program should output:This...is...our...week...on...functions - Run your program with
python playback.py. TypeLet's implement a function called helloand press Enter. Your program should outputLet's...implement...a...function...called...hello