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
printtells Python to display something on the screen.- The opening round bracket
(begins the information given toprint. "Hello!"is the text to display. Quote marks show where the text begins and ends.- 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
printasks Python to display something."CHANGE ME"is the text you should replace.
Hint
- Keep the quote marks.
- Replace only the words CHANGE ME.
- Keep the final round bracket.
Show Solution
print("Maya")Line-by-line explanation
printis the display instruction."Maya"is the new text.- The output is
Maya.