⭐ 0πŸ”₯ 0πŸ† 0 pts

For young coders and the grown-ups who help them

Python for kids: real code, right in your browser

Python for kids starts with a single line, print("Hello!"), and here a child can write it, press Run and watch it work: free, with no sign-up and nothing to install.

Quick answer

  • The Python box below runs in this page: free, no account, no download.
  • Many children are ready for typed code around 9 or 10; younger ones can start with blocks.
  • Learn Python 3 only. Python 2 stopped getting fixes on 1 January 2020.
  • Levels 4 and 5 go from print to a Guess the Number game.

Press Run, then pick another program from the Try row: one asks your name, one counts down, one rolls a dice. Change a word, run it again and see what happens.

🐍 Python boxRuns in this page. Nothing to install.
Try:
🐍 main.py
Ctrl + Enter runs it too. Esc, then Tab, leaves the code.
Output

Press β–Ά Run to see what your program does.

Start in your browser, with nothing to set up

This small Python runs on your own device, inside the page. Your code is not sent to our server and nothing is kept when you leave, so there is no account to make and nothing to break.

It knows what beginners meet first: print, variables, maths, f-strings, input, if, loops, lists, functions, and the random and math toolboxes. A mistake shows an error message like the ones real Python prints, line number included. Dictionaries, classes, tuples and files wait for a real computer: if you paste code that uses them, the box says so.

Start Level 4: Hello, Python! Β· See every level

Is my child ready for typed code?

Age is a rough guide. What matters is whether a child reads a short instruction alone and finds keys without hunting. A 2022 Raspberry Pi Foundation article puts text languages at around nine or ten, and block-based Scratch from about six, adding that children develop at different speeds.

Still hunting for letters? Blocks are kinder for now, and free first steps for kids compares the options. Signs that typed Python will feel like fun:

  • copies a line exactly, quote marks and brackets included
  • finds Shift, Enter and the bracket keys quickly
  • treats a mistake as a puzzle, not a disaster

Coding for kids

The first ideas, one lesson at a time

Python's key words sit close to English, and python.org says newcomers can find it easy to pick up. Levels 4 and 5 add one idea per lesson, and Error detective shows how to read the red text it prints.

IdeaWhat it doesLesson
printShows words on the screenHello, Python!
VariablesA labelled box: score = 10Variables
inputAsks a question, waits for an answerPrograms that listen
if and elseChooses what happens nextDecisions
for and whileRepeat lines without rewriting themfor loops, while loops
ListsA row of values, like a shopping listLists
FunctionsNamed steps made with def, used againFunctions

Make a small game: Guess the Number

Level 5's big project is Guess the Number. The computer holds a secret, a while loop asks for guesses, and if and elif reply "Too low" or "Too high" until the guess is right.

The secret starts as 7, so the game can be tested. Then two lines make it real: import random opens Python's toolbox of chance, and random.randint(1, 10) lets the computer pick the secret itself. Now not even its maker knows it.

Next, make it yours: numbers up to 100, a guess counter, a cheeky message after three misses.

Import a toolbox (random) Β· Build Guess the Number

Old tutorials: stick to Python 3

Python 2 reached its end on 1 January 2020; its makers said it would get no more fixes, not even for security problems. Old tutorials still turn up in searches, and much of their code breaks in Python 3. Two clues give them away:

  • print "Hello" with no brackets. Python 3 needs print("Hello"); try the old way in the box and it says the brackets are missing.
  • raw_input(), which Python 3 renamed input().

Moving to a real computer, with a grown-up

The box covers Levels 4 and 5. Installing Python on a real computer comes later, and it is a grown-up's job: an adult should pick the download and click through the steps.

Get Python from python.org, its official home. On Windows, Python's own documentation now recommends its install manager, offered on python.org and in the Microsoft Store as identical copies, and says the old full installer will not be made for 3.16 or later. As of November 2026 the newest release is 3.15.2; the downloads page, which has Mac versions too, shows the current one.

On Windows, the install manager adds the python command, so a program runs the way the course practises: python hello.py. Rehearse it in the practice terminal.

The real-computer checklist

A free book, and a paid one

Two books, both for Python 3 (DayOneCode has no tie to either):

  • Invent Your Own Computer Games with Python, 4th edition, by Al Sweigart: free online under a Creative Commons licence, written for complete beginners, kids and teenagers included. Its first game is Guess the Number. Running its programs needs Python installed.
  • Python for Kids, 2nd edition, by Jason R. Briggs (No Starch Press, October 2022): a paid book; the publisher's page offers one sample chapter to download.

For parents

You need no Python to help. Ask your child to run a program and explain each line to you; saying it aloud often reveals the slip.

There is no sign-up, email or password. Progress stays in this browser and shows on the Stats page, and pages for children here never show ads.

The guide for parents Β· Stats and Parent Progress

Questions and answers

What age can a child start learning Python?

Many children manage typed code from around nine or ten, once finding keys feels easy; some start earlier with an adult close by. Watch the child, not the birthday: if they can copy print("Hi") exactly and enjoy fixing slips, let them try.

Is Python good for kids?

For a child ready to type real code, yes. A one-line program does something at once, words like if, else and while read almost like English, and it is the same Python grown-ups use, so nothing learnt is wasted. Read the first few error messages together.

Should my child learn Scratch or Python first?

Under about nine, or still hunting for letters? Start with Scratch blocks, which the Raspberry Pi Foundation suggests from about six. Move to Python when pressing keys feels easy. Nothing is wasted: a loop or an if means the same in both.

Can my child learn Python for free?

Yes. Python is free and open source, and the Python box and Levels 4 and 5 here cost nothing and need no account. Al Sweigart's Invent Your Own Computer Games with Python is free to read online. Be wary of free trial classes that lead to paid courses.

What should we do when Python shows an error?

Read the bottom line first: it names the kind of mistake, such as a NameError for a misspelt name. Then check the line number above it, and the line just before. Missing brackets, quote marks and colons are common early slips, and none can harm the computer.

Sources

The facts on this page were checked against these pages (14 November 2026):

More guides

DayOneCode is an independent learning site, not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic.