Learn Python
Learn Python step by step with fun lessons, examples and challenges.
Python Basics
Learn what Python is, how programs work, how to display information, and how to write your first Python programs.
Variables
Learn how Python stores information using variables and how to work with values.
Data Types
Learn about the different types of data Python can store and work with.
Operators
Learn how Python performs calculations and comparisons.
Strings
Learn how to join text together, build messages with f-strings, measure and change text, and pick out letters and pieces of a string.
User Input
Learn how to ask the user questions with input(), save their answers, turn answers into numbers, and build fun interactive programs.
If / Else
Teach your computer how to make decisions.
Loops
Make Python repeat tasks automatically.
Break, Continue & Nested Loops
Take control of your loops! Learn how to stop a loop early, skip steps, put loops inside loops to draw patterns, loop over strings, and keep running totals.
Lists
Store multiple pieces of information together.
Tuples & Sets
Meet two new ways to group things together: tuples, which never change, and sets, which never have repeats.
Dictionaries
Learn how to store information in pairs of keys and values, look things up, change them, loop through them, and build simple nested dictionaries.
Functions
Create reusable blocks of Python code.
Modules & Random Fun
Discover Python modules! Use import to borrow ready-made tools, roll dice with random, pick surprises, shuffle lists, and do clever math with the math module.
Fixing Errors
Every programmer makes mistakes! Learn to read error messages like a detective, fix common bugs, and use try and except so your programs don't crash.
Turtle Drawing
Meet the Python turtle! Move it forward, turn it left and right, and use loops, colors, and functions to draw squares, triangles, stars, and your own art.
Classes & Objects
Build your own types of things! Learn to make classes as blueprints, create objects like pets and game characters, give them attributes and methods, and share code with inheritance.
