Table of Contents
The online edition groups the book into learning stages. The printed contents follow its eight manuscript parts and include page numbers.
Read the Preface · Download the printed edition
Getting Started
Python setup
Platform guides
Python Editors
- Jupyter Notebook
- VS Code
- Creating projects
- First Python file
- IPython exploration — return after the language basics
First programs
Resources
Python environment
Python Basics
Getting started
Data types
Working with data
Control flow
Data structures
Functions
- Python Functions
- Function Arguments and Return Values
- Flexible Arguments: *args and kwargs
- Scope and Decorators
- Python Built-in Functions
- Lambda Functions, Recursion, and Generators
Modules
Object-Oriented Programming
Classes & Objects
Instance & Class Members
Object Relationships
Interfaces & Abstraction
UML Modeling
Application Design
University Course Project
Advanced Python
Advanced Python concepts
- Introduction
- Specialized Data Structures
- Counting withCounter
- Grouping withdefaultdict
- Lightweight Records withnamedtuple
- Double-Ended Queues withdeque
- Iteration Tools withitertools
- Priority Queues withheapq
- Categorical Data withEnum
- Summary and Coding Challenges
- File Handling & Serialization
- File Handling in Python
- File Serialization
- Error Handling
- Exercise 1 — Building a Safe Calculator (Input Validation + Specific Exceptions)
- Exercise 2 — Student Registration Validator (Raising & Custom Exceptions)
- Python Testing
- Unit Testing withunittest
- Unit Testing withpytest
- Concurrency & Parallelism
- The Global Interpreter Lock (GIL)
- Threads: Best for I/O-Bound Tasks
- Processes: Best for CPU-Bound Tasks
- Async I/O with asyncio
- Project: Parallel Word Counter
- APIs & Web Scraping
- Understanding HTTP
- HTML Basics
- Fetching and Parsing Online Data
- Ethics & Responsible Web Scraping
- Project: Fetch & Parse Real Website Data