Python School

Write real Python, with Sly and Professor Curly. 6 levels and 18 lessons, from zero, free. Read the lessons here, or play them in the game, where your code runs in real Python, right in your browser.

Level 1

Hello, Python

3 lessons, then a level test

  1. Your first Python program What Python is, print(), and text in quotes.
  2. Numbers and maths Adding, multiplying, three kinds of dividing, and why 7 and "7" are different.
  3. Variables and f-strings Give values names, change them, and put them inside text.

Level 2

Making decisions

3 lessons, then a level test

  1. True or false Booleans, comparing values, and the difference between = and ==.
  2. if, elif and else Run code only when something is true, with Python’s famous indentation.
  3. Asking with input() Ask a question, and turn the answer into a number.

Level 3

Loops

3 lessons, then a level test

  1. for loops and range() Repeat code a set number of times.
  2. while loops Keep going while something is true, and stop with break.
  3. Adding things up Running totals, counting, and looping over the letters in a word.

Level 4

Lists and dictionaries

3 lessons, then a level test

  1. Lists Keep many values in one variable, and pick them out by position.
  2. Working with lists Loop over lists, slice them, sort them and add them up.
  3. Dictionaries Look things up by name instead of by position.

Level 5

Functions

3 lessons, then a level test

  1. Your own functions Wrap up code with def, give it inputs, and get answers back with return.
  2. Smarter functions Default values, giving back two things, and where variables live.
  3. String power tools Change case, split sentences into words, join them back, and more.

Level 6

Errors, files and classes

3 lessons, then the final test

  1. When things go wrong Read error messages, and catch errors with try and except.
  2. Files Save text to a file, add to it, and read it back.
  3. Classes and objects Make your own types of thing, with their own data and abilities.

Write your first Python program today

Python School is part of CurlyScript, the free game that teaches JavaScript. Your progress saves as you go.

Start learning