Skip to contentSkip to navigation

CPython 3.14 in the page, nothing to install

Python courses that run in your browser

18 modules and 60 lessons take you from your first print() to classes, generators and small projects. Every lesson ends in a Lab you solve yourself and a quiz the server marks.

Lessons and the playground open without an account.

for loop Lab · Fix it · fix_it.py Practice saved
# add up the even numbers
numbers = (3, 8, 5, 12, 7, 10)
total = 0
for n in numbers:
    if n % 2 == 0:
        total += n
print(total)
Output: 30
  • Prints 30, passed
  • Skips the odd numbers, passed
  • Keeps the for loop, passed

In numbers

The Python course in numbers

  • 60

    lessons, each with a Lab and a quiz

  • 420

    Lab tasks in 7 kinds, easy to hard

  • 720

    quiz questions in 9 kinds, marked on the server

  • 80%

    on a course final earns the certificate

  1. Introduction to Python
  2. Your First Python Program
  3. Variables & Dynamic Typing
  4. Core Data Types & Type Conversion
  5. Operators & Expressions
  6. Interactive Input & Output
  7. Conditional Branching (if / elif / else)
  8. Definite Iteration & for Loops
  9. Indefinite Loops & Loop Control
  10. Lists & Indexing Operations
  11. Tuples & Sequence Unpacking
  12. Strings & Text Representation
  13. String Methods & Text Sanitization
  14. Dictionaries & Hash Maps
  15. Set Creation & Deduplication
  16. Nested Data Structures
  17. Collections Module Tools
  18. Functions & Modular Code
  19. Positional & Keyword Arguments
  20. Recursion & the Call Stack
  21. Project: Number Guessing Game
  22. Project: Tip & Bill Splitter
  23. Project: To-Do Task Manager
  24. Lambda Functions and Higher-Order Builtins
  25. List Comprehensions
  26. Modules and Packages
  27. Reading and Writing Text Files
  28. Paths and Folders with pathlib
  29. JSON Files and Data
  30. CSV Files: Reading and Writing Tables
  31. Errors and Exceptions
  32. Handling Exceptions with try and except
  33. Raising and Defining Your Own Exceptions
  34. Classes and Objects
  35. Constructors, self and Attributes
  36. Inheritance and Method Overriding
  37. Regular Expressions
  38. Dates and Times
  39. Random Numbers and Secrets
  40. Project: Text Word Statistics
  41. Project: Personal Expense Tracker
  42. Project: OOP Bank Account System
  43. Iterators and the Iteration Protocol
  44. Generator Expressions and Lazy Evaluation
  45. Generator Functions and yield
  46. itertools: Building Blocks for Iterators
  47. Decorators
  48. Context Managers and the with Statement
  49. Special (Dunder) Methods
  50. Class Methods and Static Methods
  51. Encapsulation and Properties
  52. Type Annotations
  53. Structural Pattern Matching
  54. Assertions and Defensive Programming
  55. Advanced Regular Expressions
  56. Text Encodings and Binary Data
  57. Building a Data Pipeline
  58. Project: Server Log Analyzer
  59. Project: Caesar Cipher
  60. Project: Secure Password Generator

Each tile is one lesson.

Courses

One path, one course at a time

Start with the open course. The new courses open in order, each after the one before it.

  1. Beginner

    Python Foundations

    No prerequisite.

    • 6 modules
    • 23 lessons
    • 3 h 5 min
    • Getting Started
    • Operators and Control Flow
    • Lists, Tuples and Strings
    • Dictionaries and Sets
    • and 2 more
  2. Intermediate

    Practical Python

    Builds on Python Foundations.

    • 6 modules
    • 19 lessons
    • 2 h 34 min
    • Functional Tools and Modules
    • Files and Data Formats
    • Errors and Exceptions
    • Classes and Objects
    • and 2 more
  3. Advanced

    Python in Depth

    Builds on Practical Python.

    • 6 modules
    • 18 lessons
    • 2 h 46 min
    • Iterators and Generators
    • Decorators and Context Managers
    • Classes in Depth
    • Robust Code
    • and 2 more

Read it. Run it. Change it. Every lesson works the same way, so you always know what comes next.

  • 1 idea

    One concept a lesson, in plain words, before any code.

  • 2 examples

    Worked examples you run and change in the page.

  • 3 mistakes

    The errors people make most, and how to read them.

The Lab

A Lab for every lesson

420 tasks across 60 lessons, easy to hard, in 7 kinds. This is one Fix it task.

  1. Step 1

    Read the task

    It should add up the even numbers and print 30. It prints 15.

  2. Step 2

    Find the line

    Odd numbers pass the test on line 5, so they are added instead.

  3. Step 3

    Change one character

    n % 2 == 1 becomes n % 2 == 0.

  4. Step 4

    Run it, pass the tests

    Real CPython runs it in the page. Practice is saved; it earns no XP, quizzes do.

for loop Lab · Fix it · fix_it.py Practice saved
# add up the even numbers
numbers = (3, 8, 5, 12, 7, 10)
total = 0
for n in numbers:
    if n % 2 == 0:
        total += n
print(total)
Output: 30
  • Prints 30, passed
  • Skips the odd numbers, passed
  • Keeps the for loop, passed

Quizzes

Quizzes marked on the server

9 kinds of question. Answer keys stay on the server until you finish, and every code answer was run in real Python first.

  • Concept
  • Predict the output
  • Syntax
  • Spot the bug
  • True or false
  • Choose all
  • Fill the blank
  • Order the lines
  • Match the output
Browse quizzes

Sample question, order the lines

Put the lines in order so the program prints 6.

  1. total += n
  2. print(total)
  3. total = 0
  4. for n in range(1, 4):

Use the arrows to move a line.

Seasons

XP, seasons and certificates

A season lasts 4 months and each course keeps its own leaderboard. XP comes from verified learning, once each; Lab practice never earns it.

How XP is earned

XP for each kind of verified learning
Complete a lesson5 XP
Each correct answer in a lesson quiz2 XP
A perfect lesson quiz+6 XP
Pass a module exam at 80%40 XP
Pass a course final at 80%150 XP
Lab practice0 XP

A certificate for each course

Score 80% or more on a course final and the certificate is issued with a check code anyone can look up.

Free learner ID

What an ID Gets You

Your progress, quiz marks and files stay with you on any device. The course itself is open without an account.

  • It remembers where you stopped

    Finished lessons are ticked off, and Home points at the next one.

  • Your marks are kept

    Quiz attempts and practice results stay, with the answers you gave.

  • A drive for your own files

    Keep your own .py scripts and notes, up to 10 MB per file.

  • Wrong answers come back

    Questions you miss return in a review queue, spaced out over days.

  • Streak, XP and a leaderboard place

    Verified learning earns XP and a season board place; Lab practice earns none.

  • Notes that stay put

    Write notes on any lesson and find them all on your Notes page.

  • 20 badges and a certificate

    Badges as you go, and a certificate for each course final you pass at 80%.

  • The same place on every device

    Progress is stored against your ID, so your phone and laptop agree.

  • No email address
  • Three things to type
  • Under a minute
  • Free, with no card

Lesson one

Write your first program in the first minute