Python practice for beginners
Practise Python right here in your browser: exercises with instant checking and worked answers, and a coding game for every topic. Start with whatever you're learning now.
Exercises with answers
Practice games for every topic
Each module of the course is a set of games that practise one area of Python. Every game opens with a short video, then six levels that go from changing one word to writing the code yourself.
How Programs Work
What programming is, before any Python.
WORLD 2First Python Code
Write, run and fix a first program.
WORLD 3Storing Information
Store, change and combine information, and meet functions for the first time.
WORLD 4Making Decisions
Make a program behave differently depending on what's happening.
WORLD 5Repeating Things
Let the computer do repetitive work.
WORLD 6Writing Your Own Functions
Organise code into reusable pieces.
WORLD 7Lists
Handle many values at once.
WORLD 8Working With Text
Treat text as data the program can search and change.
WORLD 9Organizing Data
Choose the right structure for the information.
WORLD 10Real-World Tools
Use the tools that real programs depend on.
WORLD 11Objects
Understand classes, which most real Python code relies on.
WORLD 12Thinking Like a Programmer
Bring it all together, and be ready to learn alone.
How to practise well: type the code yourself rather than pasting it, predict what it will print before you press Run, and when something goes wrong, read the error message. It almost always tells you the line.
Questions people ask
Where can I practise Python online for free?
Right here: the exercises run real Python in your browser and check your answer, and Module 1 of the games is free with no account.
How should a beginner practise Python?
Little and often. Do a few short exercises on one idea, type the code yourself, predict the output before running it, and fix your own errors before looking at the answer.
Do I need to install Python to practise?
No. Everything on this site runs in your browser. When you're ready, you can install Python from python.org and run the same code on your computer.
Learn Python with games
Every idea on this page has its own game in the course, with a short video and six levels. The three games in Module 1 are free: no account, nothing to install.
Every idea on this page has its own game in the course. Pick up where you left off.
Play the first game freeContinue the courseMore free ways to learn
Fun Python code
Fun, cool Python code for beginners: I love you in Python, heart code, happy birthday programs, a rocket countdown and more. Run each one in your browser.
Teach
Free resources for teaching Python to kids and beginners: a Scratch to Python guide, printable worksheets with answers, and a game-based course.
Guides
Short guides on learning Python with games, how long it takes, and where to start.