Tech4Good Nungua
Cohort 01 · Warm-Up Before Bootcamp

Learn to make the computer do what you say.

Six short lessons to get you ready for the Innovators Bootcamp. No downloads, no fees — you write real Python code right here in the page and run it. Every example is about life in Nungua: the market, the trotro, mobile money, your own language.

6 lessons · about 2 hours total Works on a phone or a computer For students finishing basic school
The map
01

What is a computer, really?

Before you write a single line, understand the one big idea.

A computer — whether it's the phone in your pocket or a laptop — is a machine that is very fast but very literal. It cannot guess what you mean. It only does exactly what it is told, in the exact order you tell it. That's it. That's the whole secret.

Think about making kenkey. If you gave a friend the steps out of order — "wrap it, then add water, then grind the corn" — you'd get a mess. A recipe only works when the steps are clear and in the right order. Code is a recipe for the computer. Programming is just the skill of writing very clear recipes.

Why this matters for you. People sometimes think coding is about being a genius with maths. It isn't. It's about breaking a big problem into small, clear steps — the same thing a good market trader, a nurse, or a football coach already does every day.

The three parts of almost every program

Every app you know — MoMo, WhatsApp, a football score app — is just those three things, repeated many times, very fast. In the next lesson you make output happen yourself.

02

Your first lines of code

You will make the computer talk. Right now, in this page.

In Python, the command to make the computer show something on screen is print. You put what you want to show inside brackets and quotes. Press Run code below and watch.

The words inside the quotes are called a string — just text. You can print anything you like. Try changing the words to your own name, then press Run again.

Notice: each print goes on its own line, and they run top to bottom — in order, just like the recipe idea from Lesson 1.
Your turn

In the box above, change the three lines so they say your real name, your neighbourhood, and one thing you want to build one day. Run it. That message is the first thing you ever made a computer say.

03

Boxes that hold things

Variables: giving a name to a piece of information so you can use it again.

Imagine a labelled box at the market. You write "kenkey" on it and put the price inside. Later, instead of remembering the number, you just say "check the kenkey box". In code, that box is called a variable.

Three things just happened. You made three boxes (kenkey, fish, pepper), put a number in each, and then the computer added them for you with +. Change any price and run again — the total updates by itself. That is the "process" part from Lesson 1.

The rule for boxes: the name goes on the left, an = sign in the middle, and the value on the right. The = means "put this in the box," not "equals" like in maths.

Numbers vs. words

Notice prices have no quotes (they are numbers you can add), but text like "Total:" has quotes. That difference matters — the computer adds numbers, but it only shows words.

Your turn

You are buying items for a family meal. Make boxes for rice, chicken and oil with real prices, then print the total. Bonus: add a transport box for your trotro fare home and include it in the total.

04

Making decisions

Teaching the computer to choose: if this, then that.

So far the computer just does everything. But real apps decide. When you try to send MoMo, it checks: do you have enough money? If yes, it sends. If no, it warns you. In Python that check is the word if.

Read it out loud like English: "if balance is greater-than-or-equal-to fare, print the good message; else print the warning." Change balance to 2 and run it — now the other message shows.

The two most important details: the line ends with a colon :, and the line below it is pushed in (indented) with spaces. That spacing is how Python knows which lines belong to the decision. Keep it — the code breaks without it.

The comparison words

Your turn

A pregnant woman should visit the clinic if her temperature is 38 or higher (this is the idea behind KlinikAlert). Make a box temperature = 39 and write an if / else that prints "Go to the clinic" or "You are okay". Try different temperatures.

05

Doing it again and again

Loops: the trick that makes computers so powerful.

Suppose you must greet 30 classmates. You wouldn't write 30 lines. Computers are built to repeat. A loop says "do this for every item in the list." Watch it greet in all three of our languages:

The list is inside square brackets [ ]. The loop goes through it one item at a time, and each time, word becomes the next greeting. Three items, so the message prints three times — but you only wrote it once. Add a fourth greeting to the list and run again; the loop handles it automatically.

Why coders love this: whether the list has 3 names or 3,000, the loop is the same length. This is exactly how an app sends a message to a whole community at once.

Looping with numbers

range(1, 6) gives the numbers 1, 2, 3, 4, 5 (it stops before 6). Loops plus lists are enough to build surprisingly real things — which is what you'll do next.

Your turn

Make a list of five fish sold at the Nungua shore — ["tilapia", "salmon", "herring", ...] — and use a loop to print "Fresh tilapia for sale!" for each one.

06

Build a tiny project

Everything together: a baby version of SeaPrice, the fish-market price checker.

You now know the four building blocks: print, variables, if/else, and loops. Real programs are just these combined. Here is a small price checker that looks through today's fish prices and tells the buyer which ones fit their budget. Run it, read it, then change the numbers.

Look what you understand now: a variable for the budget, a list of fish and prices, a loop to check each one, and an if/else to decide. That is a genuine program. Every big app is this same idea, just larger.

Final challenge

Change the budget to 20 and run it — more fish should now say "you can buy this." Then add two more fish to the list with their prices. You just edited a real program's data, the way a working developer does.

You're ready. If you followed to here, you already understand more than most people ever will about how technology works. Come to the bootcamp with this file open — we build from exactly this point. See you in Nungua. Akwaaba.
Starting the code engine…