Python · Glossary
Python Programming Glossary — 50 Terms You Must Know in 2026
Quick summary — Python programming glossary
This Python programming glossary explains 50 essential terms in plain English, grouped into basics, functions and object-oriented programming, tools, and advanced ideas. Learn the basics group first, because terms like mutable, iterable and exception appear in every tutorial, then move on to decorators, virtual environments and type hints.
In this guide you will learn:
- Basics — 14 terms on data types, control flow and errors.
- Functions and OOP — 14 terms on structure and reuse.
- Tools — 14 terms on packages, environments and testing.
- Advanced — 8 terms to grow into next.
- Study tips — how to make the terms stick.
SECTION 01Basics: data, flow and errors (14 terms)
These are the words you meet in your first weeks of Python. They describe how values are stored, how code makes decisions and loops, and what happens when something goes wrong. Understanding the difference between mutable and immutable objects, and between iterables and iterators, prevents many beginner bugs.
| Term | Plain meaning | Tiny example | Why it matters |
|---|---|---|---|
| Variable | A name that refers to a value | price = 99 | Every program uses them |
| Mutable | An object that can be changed in place | list, dict, set | Changes are visible through every name pointing to it |
| Immutable | An object that cannot be changed after creation | int, str, tuple | Safe as dict keys |
| Exception | An error raised while the program runs | ValueError, KeyError | Handled with try/except |
5. Data type Kind of value: int, float, str, bool, list...
6. String Text in quotes: "hello"
7. List Ordered, changeable collection: [1, 2, 3]
8. Tuple Ordered, unchangeable collection: (1, 2)
9. Dictionary Key-value pairs: {"name": "Asha"}
10. Set Unordered unique items: {1, 2, 3}
11. Iterable Anything you can loop over (list, str, dict)
12. Indentation Spaces that define code blocks in Python
13. None Python's "no value" object
14. f-string Formatted string: f"Total: {price}"
scores = [70, 85, 90] # list (mutable)
scores.append(60) # changed in place
point = (3, 4) # tuple (immutable)
student = {"name": "Asha", "city": "Noida"} # dictionary
for s in scores: # a list is iterable
if s >= 80:
print(f"{s} is a distinction")
try:
int("abc")
except ValueError as e: # exception handling
print("Not a number:", e)
SECTION 02Functions and object-oriented terms (14 terms)
Once you can write simple scripts, you start organising code into functions and classes. These terms describe how functions receive inputs, return results, and how classes bundle data with behaviour. You will meet them in every framework, from Flask and Django to pandas.
| Term | Plain meaning | Tiny example | Why it matters |
|---|---|---|---|
| Function | A reusable block of code with a name | def area(r): ... | Avoids repetition |
| Argument | A value passed into a function call | area(5) | Makes functions flexible |
| Class | A blueprint for creating objects | class Student: ... | Groups data and behaviour |
| Decorator | A function that wraps another to add behaviour | @app.get("/") | Used widely in frameworks |
19. Parameter Name in the def line that receives a value
20. Return value Result a function sends back with return
21. *args Collects extra positional arguments as a tuple
22. **kwargs Collects extra keyword arguments as a dict
23. Lambda Small anonymous function: lambda x: x * 2
24. Scope Where a name can be used (local, global)
25. Object An instance created from a class
26. Method A function defined inside a class
27. self Refers to the current object inside methods
28. Inheritance A class reusing and extending another class
import time
def timer(func): # a decorator
def wrapper(*args, **kwargs):
start = time.perf_counter()
result = func(*args, **kwargs)
print(f"{func.__name__} took {time.perf_counter() - start:.4f}s")
return result
return wrapper
class Student: # a class
def __init__(self, name): # self = this object
self.name = name
@timer
def greet(self, greeting="Hello"): # a method
return f"{greeting}, {self.name}"
print(Student("Rahul").greet())
SECTION 03Tools and workflow terms (14 terms)
Writing code is only part of programming in Python. You also install packages, isolate projects, run tests and share code. These terms appear in setup instructions, job descriptions and README files, so knowing them saves hours of confusion when you clone someone else's project.
| Term | Plain meaning | Tiny example | Why it matters |
|---|---|---|---|
| pip | Python's package installer | pip install requests | Installs libraries |
| Virtual environment | An isolated folder of packages per project | python -m venv .venv | Avoids version clashes |
| Module | A single .py file you can import | import utils | Organises code |
| Package | A folder of modules, or an installable library | pandas, requests | Reuses others' work |
33. requirements.txt File listing a project's packages
34. PyPI Python Package Index, where pip finds packages
35. Interpreter The program that runs Python code
36. REPL Interactive prompt: type code, see result
37. Script A .py file you run directly
38. __name__ "__main__" when a file is run directly
39. Linter Tool that flags style and simple errors
40. Formatter Tool that rewrites code style (e.g. black)
41. Unit test Small test for one function
42. Debugger Tool to pause code and inspect values (pdb)
python -m venv .venv # create virtual environment
source .venv/bin/activate # activate (Windows: .venv\Scripts\activate)
pip install requests pytest # install packages
pip freeze > requirements.txt # record versions
pip install -r requirements.txt # recreate elsewhere
python -m pytest -q # run unit tests
python -m pdb app.py # start the debugger
SECTION 04Advanced terms to grow into (8 terms)
You do not need these on day one, but you will meet them as projects grow. Learn them once the basics feel natural.
43. List comprehension
Build a list in one line:
squares = [n * n for n in range(10) if n % 2 == 0]
44. Generator
A function that yields values one at a time,
saving memory:
def count_up(n):
for i in range(n):
yield i
45. Context manager
Sets up and cleans up automatically with "with":
with open("data.txt") as f:
text = f.read()
46. Type hint
Optional annotation of expected types:
def total(prices: list[float]) -> float:
return sum(prices)
47. Dataclass
Class that auto-creates __init__ and more:
from dataclasses import dataclass
@dataclass
class Item:
name: str
price: float
48. Iterator
Object returning items one by one with next()
49. async / await
Lets code wait for slow I/O (like network calls)
without blocking other tasks:
import asyncio
async def main():
await asyncio.sleep(1)
print("done")
asyncio.run(main())
50. GIL (Global Interpreter Lock)
In standard CPython, a lock that lets only one
thread run Python bytecode at a time; matters
for CPU-heavy multithreaded code.
SECTION 05Tips to make Python terms stick
Reading a glossary once is not enough. These habits help:
- Learn five terms a day — ten days covers this whole list.
- Type every example — muscle memory helps vocabulary stick.
- Explain terms out loud — if you can explain "mutable" to a friend, you know it.
- Spot terms in real code — open a library's source and find decorators or generators.
- Use terms in your README files — precise language makes your projects look professional.
SECTION 06Interview Q&A — Python terms
Q1What is the difference between a list and a tuple?
Both are ordered collections. A list is mutable, so items can be added or changed; a tuple is immutable once created, which makes it suitable for fixed data and as a dictionary key when its items are hashable.
Q2What is a decorator in Python?
A decorator is a function that takes another function and returns a new function with added behaviour. The @decorator syntax is shorthand for reassigning the function to the decorated version.
Q3Why use a virtual environment?
It isolates each project's packages, so different projects can use different library versions without conflicts, and requirements can be reproduced on another machine.
Q4What is a generator and why is it useful?
A generator produces values lazily with yield, one at a time, so it can handle large or infinite sequences without storing everything in memory.
Q5What does if __name__ == "__main__" do?
It runs the code inside only when the file is executed directly, not when it is imported as a module by another file.
SECTION 07Test yourself — Python terms quiz
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 08Frequently asked questions
What are the basic terms in Python programming?
Start with variable, data type, string, list, tuple, dictionary, set, loop, condition, function, argument, return value, exception and module. They appear in nearly every beginner tutorial.
What is the difference between a module and a package in Python?
A module is a single .py file. A package is a collection of modules, usually a folder; the word is also used for installable libraries from PyPI.
What is PEP 8?
PEP 8 is Python's official style guide. It covers naming, indentation, line length and other conventions that make code consistent and readable.
Do I need to learn all Python terms before coding?
No. Learn terms as you meet them in practice. The basics group here is enough to start writing useful programs.
What Python terms come up most in interviews?
Mutable and immutable types, list versus tuple, decorators, generators, *args and **kwargs, exceptions, virtual environments and, for experienced roles, the GIL.
SECTION 09Related reads
Classroom & online · Noida
Turn Python vocabulary into real skill
Our Python Training Course takes you from Python basics through functions, OOP, packages and testing with projects that use every term in this glossary.
Talk to a counsellor for current fees- Python basics to OOP
- Tools, testing and debugging
- Real-world projects
- Weekday & weekend batches