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.
How a phone or laptop follows instructions — and why code is just very clear instructions.
02Make the computer speak. Say Akwaaba to the world and print your own name.
Variables and numbers — track kenkey prices and add up a market bill.
04If this, then that. Check if you have enough on mobile money to pay a trotro fare.
05Loops. Greet a whole classroom in Twi, Ga and English without repeating yourself.
06Put it together: a small market price checker, like a baby version of SeaPrice.
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.
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.
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.
print goes on its own line, and they run top to bottom — in order, just like the recipe idea from Lesson 1.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.
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.
= sign in the middle, and the value on the right. The = means "put this in the box," not "equals" like in maths.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.
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.
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.
:, 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.>= greater than or equal to · <= less than or equal to> greater than · < less than== is exactly equal to (two equals signs — this is a question, not a box)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.
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.
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.
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.
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.
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.