Prerequisites & Notation
Before You Begin
This chapter assumes you once knew Python reasonably well but may be rusty. If any of these items feel completely foreign (not just forgotten), review the linked material first.
- Basic programming concepts: variables, loops, functions, conditionals
Self-check: Can you write a function that takes a list and returns the sum of its elements?
- Command-line usage: navigating directories, running scripts
Self-check: Can you open a terminal, navigate to a directory, and run
python script.py? - Basic Python syntax: indentation, imports, print statements
Self-check: Can you write
import math; print(math.sqrt(2))without looking it up?
Notation for This Chapter
Symbols and conventions introduced in this chapter. Python-specific notation is used throughout the book.
| Symbol | Meaning | Introduced |
|---|---|---|
| Python virtual environment (isolated package namespace) | s01 | |
| Cross-platform package and environment manager for scientific Python | s01 | |
| `__init__`, `__repr__`, etc. | Dunder (double-underscore) methods — Python's object protocol hooks | s02 |
| , , | Time complexity of operations on data structures | s03 |
| Python keyword that turns a function into a generator (lazy iterator) | s04 | |
| f-string with format spec — Python's preferred string interpolation | s05 |