Big Idea
A programming language is a precise way of giving instructions to a computer. Python is one such language — designed from the ground up to be readable, beginner-friendly, and powerful enough for professional use. Understanding why Python was built the way it was will help you write better code and learn faster.
1 What Is a Programming Language?
Computers only understand one thing at the lowest level: electricity — on or off, 1 or 0. Writing software directly in 1s and 0s would be maddening. A programming language is a layer on top of that raw hardware, giving humans a way to write instructions that are close to plain English and that the computer can ultimately execute.
Think of a programming language as a recipe format. The recipe (your code) is written in a language you can read and reason about. The kitchen equipment (the computer) cannot read English, but a translator turns your recipe into actions the kitchen can perform. Different recipe formats — metric, imperial, restaurant notation — are like different programming languages: they solve the same problem but make different trade-offs.
1.1 A Short History of Programming Languages
Programming languages have evolved over decades, each generation making it easier to express ideas:
| Era | Example Languages | What Changed |
|---|---|---|
| 1940s–50s | Machine Code, Assembly | Programmers wrote raw binary or short mnemonics. Incredibly powerful, but almost impossible to read. |
| 1960s–70s | FORTRAN, C | Higher-level languages abstracted hardware. You could write loops and functions in something resembling maths or English. |
| 1980s–90s | C++, Java | Object-oriented languages let programmers model real-world things. Programs became much larger and more organised. |
| 1990s–now | Python, JavaScript, Ruby | Scripting and general-purpose languages prioritised developer productivity. Getting something working quickly became as important as raw speed. |
2 Compiled vs. Interpreted Languages
One of the most important differences between programming languages is how they get turned into instructions the computer can run. There are two main approaches: compiling and interpreting.
2.1 Compiled Languages
A compiled language is translated all at once before the program runs. A special program called a compiler reads your entire code, checks it for errors, and produces a new file — the executable — written in machine code that the computer can run directly.
Imagine hiring a professional translator to convert an entire novel from French to English before anyone reads it. The translation takes time upfront, but once it is done, every reader gets the fast, finished English version. Compiled programs work the same way: slow to prepare, fast to run.
Examples of compiled languages: C, C++, Rust, Go.
2.2 Interpreted Languages
An interpreted language is translated line by line as the program runs. A program called an interpreter reads your code, translates one instruction at a time, and executes it immediately — all while the program is running.
Imagine a human interpreter at the United Nations who listens to a speaker in French and translates each sentence into English in real time. The audience hears the meaning almost immediately — but the interpreter has to work continuously the whole time. Python works this way: each line is translated and run in the moment.
Examples of interpreted languages: Python, JavaScript, Ruby.
2.3 Comparing the Two Approaches
| Compiled | Interpreted |
|---|---|
| Translated all at once, before running. | Translated line by line, as it runs. |
| Produces a separate executable file. | No separate file — runs directly from source code. |
| Errors are found before the program starts. | Errors appear when that specific line is reached. |
| Generally faster to execute. | Generally slower to execute. |
| Must recompile after every change. | Save and run immediately — great for testing. |
| Examples: C, C++, Rust. | Examples: Python, JavaScript, Ruby. |
In practice, modern languages blur this line. Python compiles your code to an intermediate form called bytecode first, then interprets that bytecode. But for now, thinking of Python as interpreted is accurate enough — you save a file, you run it, you see results.
- In your own words, what is the difference between a compiled language and an interpreted language?
- If you make a typo in a compiled program, when do you find out — before or after the program runs? What about an interpreted program?
- Why might an interpreted language be more beginner-friendly, even if it runs more slowly?
- True or False: Python produces a separate
.exefile that you send to someone to run. Explain your answer.
3 Why Python? The Design Goals of the Language
Python was created in 1991 by a Dutch programmer named Guido van Rossum. He was not trying to build the fastest language, or the most powerful language. He had a specific goal: make a language that is a pleasure to use.
Van Rossum gave Python a set of guiding principles, sometimes called The Zen of Python. You can actually read them by typing this in Python:
import this
3.1 Readability Counts
Python code is meant to read almost like English. Compare these two programs that do the same thing — print the numbers 1 to 5:
| C (compiled, older style) | Python (interpreted) |
|---|---|
| #include <stdio.h> int main() { for (int i = 1; i <= 5; i++) { printf("%d\n", i); } return 0; } | for i in range(1, 6): print(i) |
Both programs print the same output. But even without knowing either language, you can probably guess what the Python version is doing. That is intentional.
3.2 Indentation Is Meaning
In many languages, curly braces { } are used to group blocks of code. Python uses indentation — how far a line is indented — to show structure. This forces code to look organised:
if temperature > 30:
print("It is hot today.")
print("Drink some water.")
print("Have a good day!")The two indented lines only run if the temperature is above 30. The last line always runs. Indentation is not optional decoration — it is part of the language's grammar.
Languages that use braces let programmers write messy, inconsistent code that still runs. Python's indentation rule means all Python code, written by anyone, follows the same visual structure. When you read someone else's Python, the shape of the code tells you how it works.
3.3 Batteries Included
Python ships with an enormous standard library — a collection of ready-made tools for common tasks. Need to work with files? There is a module for that. Need to sort data, connect to the internet, or generate random numbers? There are modules for all of those too.
This is sometimes called "batteries included" — the language comes fully equipped out of the box, without needing to hunt for extra tools to do basic things.
3.4 General-Purpose
Python is used in an astonishing range of fields. This matters to you because what you learn in this course is not a narrow skill — it transfers.
| Field | What Python Is Used For |
|---|---|
| Web Development | Building the back-end logic of websites and apps (used at Instagram, Pinterest, Dropbox). |
| Data Science & AI | Analysing large datasets, building machine learning models, training AI systems. |
| Science & Research | Running experiments, processing sensor data, modelling climate and biology. |
| Automation | Writing scripts that automate repetitive tasks — renaming files, sending emails, scraping data. |
| Game Development | Scripting game logic and prototyping mechanics. |
| Education | The most widely taught first language in universities and secondary schools worldwide. |
3.5 There Should Be One Obvious Way to Do It
One of Python's philosophical goals is that for any given task, there should be one obvious, natural way to write it. Some languages offer five different syntaxes for the same operation. Python tries to reduce those choices so programmers spend less time debating style and more time solving problems.
This is why Python code written by different people often looks similar — the language gently steers everyone toward the same patterns.
- Who created Python, and what was his primary goal — speed, power, or something else?
- What does "indentation is meaning" actually mean in Python? What happens if you indent a line incorrectly?
- What does "batteries included" mean? Give one example of something Python can do without downloading extra tools.
Look at this code. What do you think it does? Explain line by line in plain English:
name = input("What is your name? ") print("Hello, " + name + "!")- Name two completely different fields where Python is used professionally. Why might learning one language cover both?
4 Python in This Course
In DSTP Grade 9, Python is the language you will use to build, test, and explain working programs. You are not expected to memorise every detail in this article before you start coding. The goal right now is to have a mental model: a rough picture of what Python is, where it came from, and why it works the way it does.
As you write more code, these ideas will become clearer. Return to this article when something feels confusing — the explanation may land differently after you have seen the concept in practice.
| What you will do in this course | Why it connects to this article |
|---|---|
Save a .py file and run it immediately. | Python is interpreted — no compile step needed. |
| Read someone else's code and predict its output. | Python's readability makes this possible. |
| Use indentation to structure if-statements and loops. | Indentation is meaning in Python. |
Import modules like random or csv. | Python's "batteries included" standard library. |
| Write the same program multiple ways, then pick the clearest. | "There should be one obvious way." |
5 Final Check: The Big Picture
A programming language gives humans a readable way to instruct computers. Python is interpreted (runs line by line), designed for readability, ships with powerful built-in tools, and is used professionally across almost every technical field. Its design philosophy — readable, consistent, practical — is also a philosophy for how to write good code.
- In one sentence, explain what a programming language is to someone who has never heard the term.
- What are the two things a compiler does before a compiled program can run?
- Why can Python programs start running faster (from a developer's perspective) than compiled programs — even though compiled programs execute faster once they are running?
- Imagine a classmate says: "Python is only for beginners — real programmers use C++." How would you respond, using at least two facts from this article?
Predict: if you run this Python program, what will you see?
x = 10 y = 3 print(x + y) print(x - y) print(x * y)