文章索引
Expressions, Numbers, and Operations
From numeric types and common operators to precedence and floating-point pitfalls, covering the basics of Python operations.
Control Flow and Iteration
Covering if, for, while, break, continue, and common iteration patterns.
Core Data Types and Containers
Using list, tuple, dict, and set as the main thread, covering the most common Python containers and selection criteria.
Strings and Formatting
From basic string operations and concatenation to f-string, format, and legacy formatting, covering the most common patterns.
Function Arguments and Calling
Covering positional arguments, keyword arguments, default arguments, variable arguments, and common pitfalls in parameter design.
Return Values, Unpacking, and Multi-Result Design
Explaining Python's return value semantics, multiple return values, unpacking, and when to use dictionaries or data classes instead.
Files, I/O, and Exception Handling
Covering input, open, with, try/except, and common error handling practices.
Modules, Imports, and Common Standard Libraries
Explaining the basic rules of import and covering common standard libraries like collections, pathlib, json, and math.