Interactive · runs in your browser

Python Lab

Learn Python — the language of AI — by writing and running real code, auto-graded as you go. 44 modules · 308 lessons. First lesson of every module is free.

Module 1

Variables & Print

Make Python say things and remember things.

7 lessons · ~26 min
Module 2

Strings

Join, clean, slice, and measure text.

7 lessons · ~26 min
Module 3

Lists

Keep groups of items in order and work with them.

7 lessons · ~26 min
Module 4

Conditionals

Make Python choose what happens next.

7 lessons · ~26 min
Module 5

Loops

Repeat actions without copying code.

7 lessons · ~26 min
Module 6

Functions

Build reusable tools with inputs and outputs.

7 lessons · ~26 min
Module 7

Dicts, Tuples, and Sets

Store values by key, keep fixed pairs, and remove duplicates.

7 lessons · ~26 min
Module 8

Nested Data

Read and update data inside bigger data structures.

7 lessons · ~26 min
Module 9

Files and JSON

Save data to files and move between text and JSON.

7 lessons · ~26 min
Module 10

Errors and Assertions

Handle mistakes without crashing your whole program.

7 lessons · ~26 min
Module 11

Comprehensions

Build collections in one clean expression.

7 lessons · ~26 min
Module 12

Imports and the Standard Library

Reuse Python's built-in modules and tools.

7 lessons · ~26 min
Module 13

Classes and Objects

Create your own objects with data and behavior.

7 lessons · ~26 min
Module 14

OOP Patterns

Use inheritance and richer class patterns.

7 lessons · ~26 min
Module 15

Iterators and Generators

Work with streams of values one step at a time.

7 lessons · ~26 min
Module 16

Advanced Python

Use flexible function features and advanced language patterns.

7 lessons · ~26 min
Module 17

Modules and Packages

Split Python code across files and folders.

7 lessons · ~26 min
Module 18

Testing and Debugging

Check that code works and find problems faster.

7 lessons · ~26 min
Module 19

Functional Python

Transform data with higher-order tools and pure functions.

7 lessons · ~26 min
Module 20

Context Managers and Decorators

Wrap setup and behavior in reusable Python patterns.

7 lessons · ~26 min
Module 21

Regular Expressions

Match, find, and clean text patterns with `re`.

7 lessons · ~26 min
Module 22

SQLite Databases

Store and query data with SQL inside Python.

7 lessons · ~26 min
Module 23

HTTP and APIs

Build requests, parse URLs, and handle API-style data.

7 lessons · ~26 min
Module 24

Concurrency

Run tasks with threads, queues, locks, and executors.

7 lessons · ~26 min
Module 25

Asyncio

Write asynchronous code with `async`, `await`, and tasks.

7 lessons · ~26 min
Module 26

CLI and Tooling

Build command-line tools and work with runtime settings.

7 lessons · ~26 min
Module 27

Performance and Profiling

Measure speed and improve expensive code paths.

7 lessons · ~26 min
Module 28

Data Modeling and Typing

Model data cleanly with enums, structured types, and typing tools.

7 lessons · ~26 min
Module 29

NumPy Basics

Work with numeric arrays for faster data science code.

7 lessons · ~26 min
Module 30

Pandas Basics

Work with labeled tables using Series and DataFrames.

7 lessons · ~26 min
Module 31

Data Cleaning

Fix missing, messy, and duplicate data before modeling.

7 lessons · ~26 min
Module 32

Data Visualization

Plot data so patterns are easier to spot.

7 lessons · ~26 min
Module 33

ML Math and Statistics

Use the core math ideas behind machine learning models.

7 lessons · ~26 min
Module 34

Train-Test Workflow

Split data, fit models, and keep evaluation honest.

7 lessons · ~26 min
Module 35

Regression

Predict continuous values like scores, prices, or times.

7 lessons · ~26 min
Module 36

Classification

Predict category labels like pass/fail or spam/not spam.

7 lessons · ~26 min
Module 37

Clustering and Unsupervised Learning

Find patterns in unlabeled data.

7 lessons · ~26 min
Module 38

Feature Engineering

Turn raw data into model-friendly features.

7 lessons · ~26 min
Module 39

Model Evaluation

Use the right metrics to judge model quality.

7 lessons · ~26 min
Module 40

Model Improvement

Tune models, choose features, and fight overfitting.

7 lessons · ~26 min
Module 41

Neural Network Basics

Understand neurons, activations, and forward passes.

7 lessons · ~26 min
Module 42

PyTorch Basics

Work with tensors, autograd, and simple neural network pieces.

7 lessons · ~26 min
Module 43

Deep Learning Workflow

Build datasets, training loops, validation loops, and saved models.

7 lessons · ~26 min
Module 44

ML Capstone

Put the full ML workflow together from raw data to saved model.

7 lessons · ~26 min
Free Tools & Calculators