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.
const name = "you";
for (let i = 3; i > 0; i--) {
console.log(i + "...");
}
console.log(`Hi ${name}!`);
Change you, then press Run.
CREATE TABLE snacks (name TEXT, price REAL);
INSERT INTO snacks VALUES
('Crisps', 1.20),
('Pretzels', 0.99),
('Chocolate', 1.50);
SELECT name, price FROM snacks
WHERE price < 1.30
ORDER BY price;
Change 1.30, then press Run.
#include <stdio.h>
int main(void) {
int lives = 3;
while (lives > 0) {
printf("%d lives left\n", lives);
lives--;
}
printf("game over\n");
return 0;
}
Change 3, then press Run.
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.
-
Python
Write, test and debug your own programs: data in lists and dicts, files and JSON, functions and classes.
Start Python -
JavaScript + HTML/CSS
Build web pages that look right on any screen, react to clicks and typing, and load data from an API.
Start Web
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 playgroundTraceback (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.