Python & coding · Pillar guide

Python for kids and beginners: your first learning path

The first goal is not to memorise every Python command. It is to write a small program, predict what it will do, and change it on purpose. This guide helps a learner or parent choose a starting point, run a short example and decide what to practise next. No coding experience is required.

Choose a starting point by readiness, not a fixed birthday

A learner who can read short instructions, type a sentence and stay curious after an error can try a text-based program with support. Someone who is still getting comfortable with typing may prefer a block-based environment first. Neither route is a race. Sit together for the first session and notice whether the learner can explain a change rather than simply copy it.

The Raspberry Pi Foundation discusses readiness and different starting tools. Its guidance is context for choosing an approach, not a guarantee that every child of one age needs the same language. Knowledge Wave’s existing Python for Kids & Teens course is one option for learners who want live guidance.

Open a Python 3 editor and run one file

Use an existing school-approved Python 3 editor or a local Python 3 installation. Ask an adult or school administrator before installing software on a managed device. In a file-based editor, create a file called pet_plan.py, enter the example below and use Run. In a terminal with Python installed, the command is usually python pet_plan.py or python3 pet_plan.py.

Type only the code, not the three-chevron interactive prompt you may see in other tutorials. Do not enter your real name, school or contact details: a fictional pet name is enough. This example needs no package installation or online account.

pet = "otter"
name = input("What is your pet's name? ")
snacks = 3
print(f"{name} the {pet} has {snacks} snacks.")

for day in range(1, 4):
    print(f"Day {day}: practise one new skill.")

If you enter Pip, the first message is “Pip the otter has 3 snacks.” Three numbered practice lines follow. Predict the output before running it again, then change the animal and snack count. Keep quotation marks around words, but leave a number unquoted when you intend to calculate with it.

Learn the next idea only when you can use the previous one

IdeaSmall taskExplain before moving on
Variables and valuesChange the animal and snack count.Which values are text, and which are numbers?
Input and conversionAsk for a whole-number snack count using int(input(...)).What happens if someone types a word?
DecisionsPrint a different message when the count is zero.Why does only one branch run?
LoopsPrint five numbered practice days.Why does range stop before its second argument?

The starter uses range(1, 4), which gives 1, 2 and 3. To include day 5, use range(1, 6). Once the learner can predict these changes, try the number guessing game lesson, which combines input, comparison, repetition and input validation.

Make debugging part of the lesson

Read the error type and the line Python points to, then inspect that line and the one immediately before it. A missing quotation mark can make the next line look wrong. Keep indentation consistent: the line inside the for loop is indented, while the earlier print line is not.

If a program runs but gives an unexpected result, use a short print statement to inspect a value. Change one thing at a time. Ask the learner to state what they expected and what actually happened before an adult fixes the code. That explanation is often more useful than finishing quickly.

For reference, the official Python introduction explains basic values and expressions, and the built-in functions reference describes input and conversion. Our examples are independently written and use ordinary Python 3 features.

Common questions

Can a child learn Python with no coding experience?

Yes, a beginner can start with a short program and adult support where needed. Begin with changing text and numbers, predicting the output and explaining what changed. If reading and typing are still difficult, a block-based language may be a more comfortable starting point before text-based Python.

What is a good first Python program for kids?

A small program that asks for a fictional pet's name and prints a message is a manageable first project. The example above adds a number and a short loop. Run it once, change one value, then predict the new output before running it again. No extra Python packages are needed.

What age should a child start learning Python?

Readiness is more useful than a fixed birthday. Look for comfort reading short instructions, typing a few lines and trying again after an error. A parent or teacher can help with setup and debugging. Choose a simpler starting tool if the typing or syntax overwhelms the learning task.

Why does range(1, 4) stop at 3 in Python?

Python's range includes its starting value and excludes its stopping value. With the default step of 1, range(1, 4) produces 1, 2 and 3. To print five numbered practice days starting at 1, use range(1, 6). Predict the values before changing the loop.