Skip to content

Python practice

Practice Python online: 10 exercises, graded problems and a playground

The Python here is real CPython, compiled to WebAssembly by the Pyodide project and loaded into your browser tab — so print, input, f-strings, lists and dictionaries behave exactly as they do on your own machine. The exercises start from a program that already works and ask you to fix or extend one thing; the playground is a blank editor for whatever you want to try next.

checked exercises
10
graded problems
24
lessons
9
cheat sheet
1

Python practice exercises

How the path works →

In order, each one introducing a single new idea. Press Run to check your answer; hints open one at a time.

  1. Hello, Out Loudprint() puts text on the screen
  2. Name TagA variable is a reusable name for a value
  3. Party PlannerPython does arithmetic with + - * // and %
  4. Umbrella or Notif/else chooses between two different outcomes
  5. CountdownA for loop with range() repeats an action
  6. The Clapping GameAn if inside a for loop, decided again on every pass
  7. The Scoreboardf-strings build text with values inside it
  8. Packing ListA list holds several values in order, and a for loop walks through them
  9. Rainfall WeekA variable made before a loop carries a running total from pass to pass
  10. The Cafe TicketAssembling a complete program from parts you already know

Graded Python practice problems

Checked against hidden test cases — the step up from the exercises. Some are debugging labs: the program is already broken, and the job is to find out why.

Python lessons behind the practice

All lessons →

Python cheat sheet

Everyday syntax on one page, for when you remember the idea but not the spelling.

Coding interview questions

Original questions with full model answers, for when the practice is going somewhere specific.

Questions people ask

Is this the real Python, or a simplified version?
Real CPython, the standard Python interpreter, compiled to WebAssembly by Pyodide. Standard-library modules like math, random, json and collections are available; packages that need a network or a real filesystem are not.
Can I practise input() and reading from the user?
Yes. Type the lines your program should read into the input box beside the editor, one per line, and input() reads them in order when you press Run.
Do I need to install Python to use these exercises?
No. All 10 exercises, the lessons, the cheat sheet and the playground run in the browser with nothing installed and no account. The Python guide explains how to set up a local install when you want one.
Where do I go once the beginner exercises feel easy?
The graded practice problems are checked against hidden test cases and include debugging labs where the program is already broken. After those, the Python lessons go deeper on each idea, and the coding interview questions show what employers actually ask.

Practise another language

The same kind of practice hub exists for JavaScript, TypeScript, Java, C++, C, C#, Go, PHP, Ruby, SQL, R and Bash & the Shell.