Your First Line of Code
Tell the computer what to do. In English. Almost.
Tell the computer what to do. In English. Almost.
Every programmer's first program: make the computer say hello. Click Run to execute the code. Try changing the message.
Variables store values. You can do math with them, combine them, and change them. Adjust the values and run the code.
The computer checks a condition and chooses a path. Enter a score to see if it passes or fails.
A loop runs code multiple times. Choose how many times to loop and see the pattern it creates.
The first computer bug was a real bug: a moth trapped in a relay of the Harvard Mark II computer in 1947. Grace Hopper taped it into the logbook and wrote "First actual case of bug being found."
You've written real code that a computer can execute. Variables store data, if/else makes decisions, loops repeat actions. Every app, game, and website is built from these same building blocks.
A program is a list of instructions the computer follows in order. Each line tells it to do one thing: store a value, do math, make a decision, or repeat.
A variable is a named box that holds a value. name = "Alice" stores text. age = 14 stores a number. You can change the value anytime.
if (score > 60) { print("Pass") } else { print("Fail") }. The computer checks the condition and chooses a path. This is the foundation of all logic.
for (i = 0; i < 10; i++) { ... } runs the code inside 10 times. Without loops, you would have to write the same line thousands of times.
Put your new knowledge into practice!