SypherTec
…
CHECKPOINT2 MIN READUPDATED 20 NOV 2026

Checkpoint: Your Program Decides and Repeats

Your program decides and repeats.

That is a specific claim about what the eight lessons of this part put in your hands. Run your tracker below. If you worked through the exercises in this part, it opens with your own version. If not, it opens with the finished Part 2 starter.

YOUR TRACKER AT THE END OF PART 2 · PYTHON
Tab indents. Press Escape, then Tab, to leave the editor.
CONSOLE
no output

What your program can do

At the end of Part 1, your tracker printed the same lines in the same way whatever the numbers were. Now it reacts to them.

It compares its total with your budget, and chooses one of three status messages with if, elif and else. It lists every expense with a for loop, so a new expense needs no new code. It counts and adds up with accumulators, the pattern underneath sum. It looks ahead with a while loop that runs until your savings goal is reached. It also refuses to start that loop when there is nothing left to save. It has two functions of its own: print_line, which formats a line, and count_over, which returns an answer the rest of the program can use.

You also met the sandbox's safety net. A loop that never ends is stopped after 5 seconds with KeyboardInterrupt, the same error Ctrl+C gives you in a terminal.

What it cannot do yet

Your expenses are bare numbers. The program knows you spent ₦3,500, but not on what. It cannot group spending into categories like food and transport, or give each category its own budget. Every amount is still typed into the code by hand, and one badly typed amount would stop the whole report with an error.

What comes next

Part 3 teaches data. Each expense becomes a record with a name, a category and an amount. Your tracker will total spending per category. It will read expense lines from a block of text, the way it would read a file, and skip a bad line instead of crashing. And it will sort your spending from biggest to smallest. Everything from Parts 1 and 2 stays. Part 3 gives it richer data to work on.

CHECKPOINT❮❯