Computing · Stage 6

Write Real Code

Programs & Judgement · write real code · type text-based code and run it line by line to see what it prints

✦ Computing📘 Stage 6 · S6⏱ ~13 min🧒 Ages 10–12★ Free to start
I can write text-based code that runs.
Kavi the owl for Computing
📖

Kavi Types the Real Thing

For a long time Kavi built programs by dragging coloured blocks. "But real programmers type their code," Kavi said. "They write it as text — words and symbols, one line at a time." So Kavi opened an editor and typed three lines: score = 0, then score = score + 5, then print(score). Kavi pressed Run. The computer read the lines from top to bottom, one at a time, and the screen showed 5. "It really runs!" Kavi hooted. "Each line is an instruction. A variable like score is a named box that holds a value. print shows something on the screen. And I must type it exactly — the right spelling, the right brackets, the right quotes — or it will not run." Writing real code is just this: type clear instructions, in order, and let the computer run them.

🎓

What your child will learn

1Three things you type when you write codeText-based code is a program you type as words and symbols — not coloured blocks. Each line is one instruction. Three ideas do most of the work. Tap each one to hear its job.
2Typed lines run from top to bottomHere is a tiny program typed as text. The computer runs the lines in order, one at a time, and the last line prints the answer. Press ▶ Run (or Step ›) and follow each line.
3From what you want → to the line you typeWriting code means turning an idea in your head into an exact typed line. Tap each fuzzy idea to see the real line of code that does it.
4Read the code — predict what it printsRead each tiny program, run the lines in order in your head, and predict the output. Reveal to check, then try the next one.
🔍

A peek inside

You want your program to show the word Win on the screen. Which line do you type?
to show text you use print, and the words go inside quotes

Try this at home: Code you type as words and symbols, instead of dragging blocks, is called ____ code.

Ready to play and learn?

Start the free interactive lesson, or print the handout for screen-free play.

Part of Computing · Stage 6 · S6 on KAVI Academy — a secular, whole-child learning platform for ages 5–12.