Glossary
This glossary explains common Python terms in plain English. Each entry is a mini-reference: a one-line definition, a short explanation, a runnable example, the everyday tools that go with the term, and links to the lessons where you’ll use it.
Browse by category below, or jump straight to a term. New to programming? Start with Variable, String, List, Dictionary, and Function — they underpin almost everything else.
Start with these terms
Python basics
The building blocks every program is made of.
Data types
The kinds of values Python works with.
- String
- A piece of text, written between quotes, e.g. "hello".
- Integer
- A whole number with no decimal point, e.g. 42.
- Float
- A number with a decimal point, e.g. 3.14.
- Boolean
- A value that is either True or False.
- List
- An ordered, changeable collection of items written in square brackets.
- Tuple
- An ordered, unchangeable sequence of values, written in parentheses, e.g. (3, 4).
- Set
- An unordered collection of unique items, written in braces, e.g. {1, 2, 3}.
- Dictionary
- A collection of key-value pairs for looking up values by key.
Control flow
How a program decides what to do and repeats work.
- Conditional
- Code that runs only when a condition is true (if / elif / else).
- if statement
- The statement that runs a block of code only when a condition is true.
- Loop
- Code that repeats, either over items (for) or while a condition holds (while).
- for loop
- A loop that runs once for each item in a sequence.
- while loop
- A loop that keeps repeating as long as a condition stays true.
- Exception
- An error raised while a program runs, which you can catch and handle.
- try / except
- A block that runs risky code and catches exceptions instead of crashing.
Functions
Reusable blocks of logic, and the tools built on them.
- Function
- A reusable, named block of code that can take inputs and return a result.
- Parameter
- A named variable in a function definition that receives an input value.
- Argument
- The actual value you pass to a function when you call it.
- Return value
- The value a function hands back to its caller with the return statement.
- Lambda
- A small anonymous function written in one line with the lambda keyword.
- Decorator
- A function that wraps another function to add behaviour, applied with the @name syntax above a def.
- Generator
- A function that produces a sequence of values lazily, one at a time, using yield instead of return.
- Iterator
- An object you can step through one item at a time with next(), until it is exhausted.
Object-oriented Python
Modelling things as objects with their own data and behaviour.
- Class
- A blueprint for creating objects that bundle data (attributes) with behaviour (methods).
- Object
- A single value built from a class, with its own attributes and methods. Also called an instance.
- Method
- A function that belongs to an object and is called on it with a dot, like text.upper().
- Attribute
- A piece of data stored on an object (or class), reached with a dot, like dog.name.
- Inheritance
- Defining a class that builds on another, reusing its attributes and methods.
- Dunder method
- A special method with double underscores, like __init__ or __str__, that Python calls automatically.
Files, data & scripting
Reading the world outside your program and running real scripts.
- pathlib
- Python's standard-library module for working with file and folder paths as objects.
- File path
- The location of a file or folder, as text or a pathlib Path object.
- Module
- A file of Python code you can import and reuse in other programs.
- Import
- The statement that loads a module or name so you can use it in your file.
- Command-line argument
- A value passed to a program on the command line when you run it, read in Python from sys.argv.
- argparse
- Python's standard-library module for building command-line interfaces that parse arguments and flags.
- JSON
- A text format for structured data, easily converted to and from Python objects.
- CSV
- A plain-text format for tabular data: one row per line, values separated by commas.
- Context manager
- An object used with the with statement that sets up and cleans up a resource automatically.
Tools & environment
Managing packages, versions, and confidence in your code.
- Virtual environment
- An isolated Python environment with its own installed packages, separate from the system Python.
- pip
- Python's package installer, used to add third-party libraries from PyPI.
- Package
- A folder of related modules you can import; also a library you install with pip.
- requirements.txt
- A text file listing a project's package dependencies, usually pinned to exact versions.
- Version control
- A system that records snapshots of your project over time so you can review and undo changes. Git is the most common.
- Unit test
- A small automated check that verifies one piece of code behaves as expected.
Web development
Serving pages and handling requests with a framework.
- Web framework
- A library that handles the plumbing of web requests so you can focus on your app's logic. Flask and Django are examples.
- HTTP
- The request/response protocol browsers and servers use to communicate on the web.
- API
- A defined way for programs to talk to each other and exchange data.
- Route
- A mapping from a URL path to the function that runs when someone visits it.
- Template
- An HTML file with placeholders that a web framework fills in with data before sending it to the browser.
- HTML form
- A part of a web page that collects input from the user and submits it to the server.
- Static file
- A file like CSS, JavaScript, or an image that the server sends to the browser unchanged.