AssignmentsWeek 01 · FoundationsSOP word count tracker
wk01.p8Practice exerciseWeek 01 · FoundationsOpen · due in week 1

SOP word count tracker

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.

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.

  1. Ask the user for the target word count and the number of words they've written so far.
  2. Convert both answers to integers with int().
  3. Calculate how many words they have to go (target minus words written).
  4. 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 in round(...).
  • 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 lines

How we'll grade it

Four checks, four points. Three or above is passing — we'll ask you to revise anything we can't tick.

CheckWhat we look forPt
It runsAsks both questions, prints two labelled lines.1
Uses int() twiceBoth numeric inputs are converted before the subtraction.1
Math is rightRemaining equals target minus written, every time.1
Readable outputTwo clean labelled lines a stressed-out applicant could scan in one look.1
Ready?
Hand it in
You can submit a draft and revise later if you're not done.
Begin submission →