Python · Stage 0 · Before You Code · Lesson 1 of 50

What Is a Programming Language?

Learn what code is, what a programming language does, and what “running” code actually means.

A computer is extremely fast, but it does not guess what you want. It follows small, exact instructions. Programming means writing those instructions.

Imagine telling a robot to make a sandwich. “Make lunch” is too vague. A useful recipe says: take two slices of bread, add cheese, and put the slices together. Code is a recipe written with rules the computer understands.

Here is one complete Python instruction:

print("Hello!")
Line-by-line explanation
  1. print tells Python to display something on the screen.
  2. The opening round bracket ( begins the information given to print.
  3. "Hello!" is the text to display. Quote marks show where the text begins and ends.
  4. The closing round bracket ) finishes the instruction.

Tiny Practice: Read One Instruction

Change the message so the instruction displays your first name.

Starter template

print("CHANGE ME")
Line-by-line explanation
  1. print asks Python to display something.
  2. "CHANGE ME" is the text you should replace.
Hint
  1. Keep the quote marks.
  2. Replace only the words CHANGE ME.
  3. Keep the final round bracket.
Show Solution
print("Maya")
Line-by-line explanation
  1. print is the display instruction.
  2. "Maya" is the new text.
  3. The output is Maya.