Run it!
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
Start here
- A lesson is a list of short steps. Press Continue (the arrow at the bottom) for the next one.
- After the steps come tasks: code you change and run.
- Today you type very little. You change one small thing at a time.
The buttons
- Run ▶ runs the code. What it prints appears in the dark box under it.
- Check answer tests your code. Green means correct, and you win coins.
- The lightbulb gives a hint when you are stuck.
- Reset brings the starting code back.
print("I am an example. Press the play button to run me.")
When something goes wrong
- If the code has a mistake, Python stops and shows red text.
- Under the red text, a card explains the error in English and Chinese and tells you which line to look at.
- Mistakes are normal. Read the card, fix one thing, and run again.
When a program waits for you
- Some programs ask a question with
input(). - Then a highlighted box appears: type here, then press Enter.
- Click the box, type your answer and press Enter. The program continues.
name = input("What is your name? ")
print("Nice to meet you, " + name)
Now you try
- Three small tasks. Change the code, press Run, then Check answer.
This program is switched off: the # at the start makes the line a comment, so Python skips it. Delete the #, press Run ▶ to see what it prints, then press Check answer.
Click Run to see the output here.
Change one word so the program prints I like dogs. Only the text inside the quotes changes.
Click Run to see the output here.
This program has a mistake. Press Run ▶ first and read the card under the red text: it explains the error. Then fix the line so the program prints Hello.
Click Run to see the output here.