Writing Code in Text
Computing · Programming & Algorithms · ages 11–14
Moving from blocks to a text language such as Python: print and input, variables, if, loops; reading error messages and fixing typos; writing small programs like a quiz or a times-table tester
At what age?
Usually at ages 11–14. The age is a guide: what decides whether a child is ready is the foundations below.
How do you know your child has learned it?
- Write a short Python program that uses input, a variable, an if statement and a loop
- Read an error message and use it to find and fix the problem
- Rewrite a block program they made earlier as text code
A quick check
Could your child write a short Python program that asks a question, checks the answer and keeps score?
What comes first?
- Finding and Fixing Bugs (needed): Text code produces error messages to debug
- Repeating with Loops (needed): Loops carry over from blocks to text
- Variables: Programs That Remember (needed): Text code uses the same ideas as blocks, starting with variables
What it leads to
Where to learn it
- Raspberry Pi Projects (Course · Chinese & English · ages 8–14 · Free): The Raspberry Pi Foundation's free project library (in Chinese too): build something that works, step by step, in Scratch, Python or HTML.
- Hello World! Computer Programming for Kids and Other Beginners (3rd edition) (Book · Chinese · ages 10–14): A Python introduction written by a father and son, in conversation, for parent and child to read and type along together; the third edition is fully updated to Python 3 and adds a chapter on the internet.