Lesson 5 of 6 · Getting Started · 4 min read · Updated
Why Python, and setting it up
Where Python came from, what it is used for, installing it, choosing an editor, and its reserved words.
Python was created by Guido van Rossum and first released in 1991. The name comes from the British comedy show Monty Python, not the snake. Its guiding idea is that code is read far more often than it is written, so it should read clearly.
Features
- Readable — indentation instead of braces, words such as
andandnotinstead of symbols. - Interpreted — run a file straight away, with no separate compile step.
- Dynamically typed — a variable takes whatever type you store in it; no declarations.
- Batteries included — a large standard library ships with it.
- Free and cross-platform — the same code runs on Windows, Linux and macOS.
You will find Python in automation scripts that save office workers hours, the back ends of websites, data analysis, artificial intelligence, testing, and teaching. This course teaches the language itself — the part every one of those uses shares.
Installing Python
- Download the latest Python 3 from python.org.
- On Windows, tick "Add python.exe to PATH" on the first installer screen before clicking Install.
- Open a terminal (Command Prompt) and type
python --version. You should see something likePython 3.12.4.
Warning
If Windows says 'python' is not recognized, the PATH box was not ticked. Run the installer again, choose Modify, and add Python to the environment variables — or use py instead of python, which the Windows installer always adds.
Choosing an editor
- IDLE — comes with Python. Simple, and enough for this whole course.
- VS Code — free and popular. Install the Python extension from Microsoft.
- PyCharm — a full Python IDE; the free Community edition is plenty.
Keywords and identifiers
import keyword
print(len(keyword.kwlist))
print(keyword.kwlist[:6])
print(keyword.iskeyword("class"), keyword.iskeyword("marks"))
35
['False', 'None', 'True', 'and', 'as', 'assert']
True False
Keywords are the words Python reserves for itself — if, for, def, class and the rest — so they cannot be used as names. Everything you name yourself is an identifier; the Variables topic covers the rules for those.
On Windows, python --version says python is not recognized. What most likely went wrong?
Try this now
- Install Python and confirm the version in a terminal.
- Open IDLE, type
import this, and read "The Zen of Python" — the principles behind the language.
Create a free account to save your progress, or sign in.