What you'll build
Ask for your statement of purpose target word count and how many words you've written. Print how many you have to go. The cleanest possible int() + subtraction exercise.
Requirements
The must-do parts. If any are missing, we'll ask you to take another pass.
- Ask the user for the target word count and the number of words they've written so far.
- Convert both answers to integers with
int(). - Calculate how many words they have to go (target minus words written).
- Print two labelled lines: a progress line (
You have written X of Y words.) and a remaining line (You have Z words to go.).
Bonus, if you're feeling brave
- Add a third line showing the percentage complete. Hint:
written / target * 100, then wrap inround(...). - Print a one-line encouragement at the end (e.g.
Keep going.).
Examples
What your program should look like when it runs. Lines starting with $ are typed by you; the rest is your program.
Example cell run
Target word count: 750
Words written so far: 320
You have written 320 of 750 words.
You have 430 words to go.Where to start
Copy this scaffold into a new file. You don't have to use it — it's just a friendly nudge.
# SOP word count tracker
target_text = input("Target word count: ")
written_text = input("Words written so far: ")
# TODO: convert both to int
# TODO: calculate the remaining word count
# TODO: print two labelled linesHow we'll grade it
Four checks, four points. Three or above is passing — we'll ask you to revise anything we can't tick.
| Check | What we look for | Pt |
|---|---|---|
| It runs | Asks both questions, prints two labelled lines. | 1 |
| Uses int() twice | Both numeric inputs are converted before the subtraction. | 1 |
| Math is right | Remaining equals target minus written, every time. | 1 |
| Readable output | Two clean labelled lines a stressed-out applicant could scan in one look. | 1 |