Learn

Learn to code

Pick a language, gear up your hero, and battle through short lessons you can run right on the page.

Interactive lessons

The friendliest first language — clean syntax, runs right here.

Boss

Pythus, the Coiled Serpent

0/10 lessons
Steps to boss10 / 10

“Indentation is my domain. You will slip.”

Lesson path

  1. Current lesson
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. Boss
  1. 1

    Your First Program

    Write and run your very first lines of Python, right here on the page.

    5 min · Python

  2. 2

    Variables

    Store values in named boxes called variables, then reuse them.

    6 min · Python

  3. 3

    Numbers & Math

    Use Python as a calculator — and do math with your variables.

    6 min · Python

  4. How problems work

    A 3-minute tour of one real problem: the statement, the test cases, and how your code is run and checked.

    3 min

  5. Practice: math with numbers

    0 / 2 solved

    Real problems from the Lab. Solve 2 of these 3 to move on.

  6. 4

    Working with Text

    Join text together, measure it, and change its case.

    7 min · Python

  7. Practice: working with text

    0 / 2 solved

    Real problems from the Lab. Solve 2 of these 3 to move on.

  8. 5

    Lists

    Hold many values under one name, and reach for the one you want.

    7 min · Python

  9. Practice: lists

    0 / 2 solved

    Real problems from the Lab. Solve 2 of these 3 to move on.

  10. 6

    Making Decisions

    Run different code depending on whether something is true.

    8 min · Python

  11. Practice: if and else

    0 / 2 solved

    Real problems from the Lab. Solve 2 of these 3 to move on.

  12. 7

    Loops

    Repeat work without writing it out a hundred times.

    8 min · Python

  13. Practice: loops

    0 / 2 solved

    Real problems from the Lab. Solve 2 of these 3 to move on.

  14. 8

    Reading Input

    Make your program read the numbers and text it is given, instead of typing them into the code.

    7 min · Python

  15. 9

    Functions

    Package code under a name so you can reuse it.

    9 min · Python

  16. Practice: loops and ifs together

    0 / 2 solved

    Real problems from the Lab. Solve 2 of these 3 to move on.

  17. 10

    Dictionaries

    Store values under their own names instead of numbered positions.

    8 min · Python

  18. Practice: dictionaries

    0 / 2 solved

    Real problems from the Lab. Solve 2 of these 3 to move on.

  19. 11

    Power Tools: map, filter & Comprehensions

    Python's shortcuts for transforming and filtering a list in one line.

    9 min · Python

  20. Practice: a step harder

    0 / 2 solved

    Real problems from the Lab. Solve 2 of these 3 to move on.

After the basics: the skill tree

From here the Lab branches by topic: arrays, two pointers, graphs and more. Pick any branch.

Problem-solving techniques
Optional

Classic problem-solving patterns, ordered from easiest to hardest. Examples adapt to your language — every language track has a full translation. Finish a language track first, then work through these at your own pace. Work top to bottom, since each lesson gets a little harder. Skip until you're comfortable with variables, loops, and functions.

Boss

The Algorithm Archon

0/13 lessons
Steps to boss13 / 13

“Patterns are power. Prove you see them.”

Lesson path

  1. Current lesson
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. Boss
  1. 1

    Prefix Sums

    Precompute running totals so any range sum becomes a quick subtraction.

    6 min · Python examples

  2. 2

    Frequency Counting

    Use a dictionary to count how many times each value appears.

    6 min · Python examples

  3. 3

    Two Pointers

    Walk two indices through a sorted array to find pairs or ranges in one pass.

    7 min · Python examples

  4. 4

    Sliding Window

    Track a moving subarray window to answer range questions without restarting from scratch.

    7 min · Python examples

  5. 5

    Greedy Algorithms

    Make the locally best choice at each step when that strategy is safe.

    7 min · Python examples

  6. 6

    Binary Search

    Cut a sorted list in half each step to find a value in logarithmic time.

    8 min · Python examples

  7. 7

    Stacks

    Last-in-first-out structure for matching brackets, undo logic, and monotonic scans.

    7 min · Python examples

  8. 8

    Linked Lists

    Chain nodes with next pointers — traverse, count, and update without shifting a whole array.

    8 min · Python examples

  9. 9

    Breadth-First Search (BFS)

    Explore a graph level by level — shortest steps in an unweighted grid or maze.

    9 min · Python examples

  10. 10

    Depth-First Search (DFS)

    Dive deep along one path before backtracking — great for exploring all reachable nodes.

    9 min · Python examples

  11. 11

    Graphs

    Represent nodes and edges with an adjacency list, then traverse to explore connections.

    9 min · Python examples

  12. 12

    Backtracking

    Try choices, undo when they fail, and search all valid combinations.

    10 min · Python examples

  13. 13

    Dynamic Programming

    Break a problem into overlapping subproblems, remember answers, and reuse them.

    10 min · Python examples

Guides
View all
Already comfortable writing code? Jump straight to practice problems.