What software is
A computer is a machine you can touch, but on its own it does nothing. Software is the list of instructions that tells it what to do. Follow a four-line program, first as a recipe in plain words and then in Python, as the CPU runs it one line at a time, stores numbers in memory and shows the answer on the screen.
5 quick questions
Pick an answer to see why. Your score saves with your progress.
01Which of these is software?
A browser is a program: a list of instructions. The CPU, memory and keyboard are hardware, the physical parts you can touch.
02Why is a program like a recipe?
A program, like a recipe, is a list of exact steps. The CPU carries them out one after another, top to bottom, exactly as written.
03After the line total = a + b runs (with a = 2 and b = 3), what is in memory?
The CPU reads 2 from a and 3 from b, adds them and stores 5 in a new box called total. Reading a and b does not change them.
04What does print(total) do in this program?
In Python, print shows values as text on the screen. It is how this program talks to you.
05How can the same computer be a calculator one minute and a game the next?
The hardware stays the same. Change the instructions it is given and it does something else.
Glossary
- Hardware
- The physical parts of a computer you can touch: the CPU, memory, screen, keyboard and so on.
- Software
- Instructions that tell hardware what to do. Apps, operating systems and websites are all software.
- Program
- One list of instructions that does a job, like a recipe. Running it means following the steps in order.
- CPU
- Central processing unit, or processor: the chip that carries out instructions, one after another.
- Memory
- Where the computer keeps the program it is running and the values it is working on, such as a = 2.
- Programming language
- A way of writing instructions with exact rules, so every line has one meaning. Python is one.
- Operating system
- The software that starts the computer and runs the other programs, such as Windows, macOS, Linux, Android or iOS.
Notes and sources
- Real CPUs work on several machine instructions at once, and one Python line becomes many tiny machine instructions. The result is the same as doing them one at a time, in order, which is how the figure shows it.
- The labelled boxes are a simplification. In Python a name such as a refers to an object (here the number 2) kept in memory, and memory itself is numbered by address, not by name.
- Python lines are carried out by a program called the Python interpreter, which turns each line into work the CPU can do. A later lesson shows how.
- The program on the card is real Python 3. Run it and it prints 5.
- Python Tutorial: An Informal Introduction to Python (First Steps Towards Programming)
- Python Language Reference: Assignment statements
- Python Library Reference: print()
- Python Language Reference: Objects, values and types
- Harvard CS50x 2024, Lecture 0 notes
- J. von Neumann, First Draft of a Report on the EDVAC (1945; IEEE Annals of the History of Computing reprint)
Quiz Unlocks after the last step.