Skip to content
Brainlag

Code should make sense. Learn it by writing it.

Short lessons where you type real code, see what it does and work out why. Python, JavaScript, SQL and C, right in your browser.

The Python track 48 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.

When your code breaks, Rook explains the error

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

Each project joins up what the lessons teach.

Questions

Something else? Email support@brainlag.co.uk.

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 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.