LevelJar Sign in

400+ Python lessons.
All free.

From your first print() to async and testing. Free, runs in your browser, nothing to install.

Start learning

Free. Create an account to keep your progress, or try it first without one.

main.py
print("starting")

age = int("12a")

print("age:", age)
starting
Traceback (most recent call last):
  File "main.py", line 3, in <module>
    age = int("12a")
ValueError: invalid literal for int() with base 10: '12a'

Your code runs on your own machine

The real thing, not an imitation

LevelJar runs CPython 3.14.1 in your browser, compiled to WebAssembly. The tracebacks above are what Python itself printed, not a message we wrote to look like one.

Nothing to install, nothing sent away

No interpreter to set up and no code sent to a server to be run. Your work is saved to your account so it follows you between machines.

Every exercise is checked

Each exercise has checkpoints with their own tests. A checkpoint that fails says what it expected and what it got, in the words of the exercise that set it.

What a lesson looks like

t2m1-01

Two kinds of error

Tell an error that stops the program starting from one that stops it running.

A syntax error is found before anything runs. Python reads the whole file first, and a file it cannot read does not start:

print("one")
if True
    print("two")
  File "main.py", line 2
    if True
           ^
SyntaxError: expected ':'

checkpoint 1

The program in the editor converts "12a" with int() and stops. Fix the conversion so the program runs to the end, giving age the number 12, and print age.

your answer, checked

print("starting")

age = int("12")

error_type = "ValueError"
error_value = "12a"
ran_before_error = True

print("age:", age)
  • check checkpoint 1 of 3: passed
  • check checkpoint 2 of 3: passed
  • check checkpoint 3 of 3: passed

the same answer with int("21") in place of int("12")

  • cross checkpoint 1 of 3: age should be 12, got 21.
  • check checkpoint 2 of 3: passed
  • check checkpoint 3 of 3: passed

What is inside

Four tiers, from the first line of code to writing tests and structuring a program.

Foundations

From a blank file to small working programs.

Working Python

The things you need before writing anything real.

Advanced

The features that separate working code from good code.

Applied

Structure, tests, and code meant to be maintained.

Ready when you are

Start learning

No card, no trial, no upsell. The whole course is free.