Skip to content
Brainlag

Code should make sense. Learn it by writing it.

Short lessons where you type real code, break it on purpose and work out why it works. Python, JavaScript, SQL and C, right in your browser.

The Python track 42 lessons, total beginner

name = "you"

for i in range(3, 0, -1):
    print(i, "...")

print(f"Hi {name}!")

Change you, then press Run.

Python 3.13Ln 1, Col 1

Pick a course

Every course starts with a free Foundations module and a checkpoint. Brainlag Code is the rest of the path: 129 more lessons, checkpoints, bug hunts, 27 projects and a final challenge per course.

When your code breaks, Noodle explains the error

He tells you what the error message means and where to look. He does not write the fix for you. In exercises you get hints, not answers.

Try it in the playground
Traceback (most recent call last):
  File "main.py", line 3, in <module>
    print(scroe + 1)
NameError: name 'scroe' is not defined

Build your own projects

Lessons teach one idea at a time. Projects make you glue them together. Six smaller briefs are free to start.

Questions

Something else? Email [email protected].

Is it free?

The first module of every course (with its checkpoint), the playground and the small project briefs are free. Everything after Foundations, with the bug hunts and the bigger projects, is Brainlag Code.

Do I need an account?

No. Without one, progress is kept in this browser. A free Brainlag account (the same one as on brainlag.co.uk) keeps it on every device. Brainlag Code needs an account.

Does it work on a phone?

Yes. A laptop is nicer for longer code; curly brackets on a phone keyboard are a crime.

Which language should I start with?

Python if you have never coded. HTML/CSS + JavaScript if you want to make websites. SQL if you like data. C if you want to know what the computer is really doing.

Why learn it if AI can write it?

Because someone has to know whether what it wrote is right. Reading code, spotting the bug and knowing why it runs is the part AI cannot do for you.

Can I use this for school or a coding class?

Yes. Share a lesson link; free lessons need no sign-up.

What is Brainlag?

brainlag.co.uk is a free site for students with study tools, courses and printables. This is the coding corner of it.

Code editor. Press Control or Command plus Enter to run the code. Tab indents; to move focus out of the editor, press Escape and then Tab.