Get a comprehensive, in-depth introduction to the core Python language with this hands-on book. Based on author Mark Lutz's popular training course, this updated sixth edition will help you quickly write efficient, high-quality code with Python. It's an ideal way to begin, whether you're new to programming or a professional developer versed in other languages. Complete with quizzes, exercises, and helpful illustrations, this easy-to-follow self-paced tutorial gets you started with Python 3.12 and all other releases in use today. With a pragmatic focus on what you need to know, it also introduces some advanced language features that have become increasingly common in Python code. This book helps you: Explore Python's built-in object types such as strings, lists, dictionaries, and files Create and process objects with Python statements, and learn Python's syntax model Use functions and functional programming to avoid redundancy and maximize reuse Organize code into larger components with modules and packages Code robust programs with Python's exception handling and development tools Apply object-oriented programming and classes to make code customizable Survey advanced Python tools including decorators, descriptors, and metaclasses Write idiomatic Python code that runs portably across a wide variety of platforms
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A patient, self-paced tutorial that teaches the core Python 3 language in depth—from built-in types and syntax through functions, modules, exceptions, classes, and advanced tools—for newcomers and experienced developers who want to truly understand Python rather than just copy snippets.
【Book Arc】
- **Opening (~0%–10%)**: Frames why Python matters and what this edition changes—dropping Python 2.X, updating to Python 3.12 and its era, and setting expectations for a fundamentals-first tutorial rather than a reference manual.
- **Early (~10%–35%)**: Orients you to the book's teaching philosophy, media/example resources, and the "Python Q&A" framing of its popularity, quality, and productivity claims before the technical material begins.
- **Middle (~35%–55%)**: Builds the case for Python's design—readable syntax, consistent model, standard library, integration options—and clarifies what "scripting language" does and doesn't mean in practice.
- **Late (~55%–85%)**: (Excerpts do not cover this stage in detail.) Based on the book's stated scope, this is where core language mechanics—built-in object types, statements, functions, modules/packages, exceptions, and classes—are developed in depth.
- **Ending (~85%–100%)**: (Excerpts do not cover this stage.) The book's outline points toward advanced tools such as decorators, descriptors, and metaclasses, plus idiomatic, portable Python practice.
【Key Takeaways】
- **This is a teaching book, not a lookup manual** (Early): It is structured as a self-paced course with quizzes, exercises, and illustrations, expanding recurring themes across chapters rather than listing facts. (Early)
- **Python 2.X is fully dropped; Python 3.12 is the baseline** (Early): The edition targets modern Python and previews 3.13 changes, while staying broadly applicable to other 3.X versions. (Early)
- **Fundamentals come before advanced features by design** (Early): Type hinting and async coroutines are deliberately not covered in depth because they push beginners past complexity cliffs. (Early)
- **Python's value rests on quality and productivity** (Middle): Readable, consistent syntax and a "fits your brain" design model are presented as the core reasons Python is worth learning well. (Middle)
- **"Scripting language" is a misleading label** (Middle): The book distinguishes shell-tool, control-language, and ease-of-use senses, arguing Python is far broader than any single one. (Middle)
- **The standard library and third-party ecosystem extend Python widely** (Middle): Prebuilt portable functionality plus tools like NumPy, Django, and PyTorch make Python central to STEM, web, and AI work. (Middle)
- **The book encourages critical thinking about Python itself** (Early): It critiques language changes while teaching them, treating engineering judgment as part of learning. (Early)
- **Examples and errata are maintained online** (Early): Companion files, updates, and corrections are hosted on author and publisher sites rather than GitHub, to keep beginners unblocked. (Early)
【Reading Tips】
- Read the preface and Chapter 1 carefully—they explain the edition's scope, what's intentionally excluded, and how to use the examples package.
- Treat the book as a semester-long course: work the quizzes and exercises rather than skimming, since concepts recur and build across chapters.
- Skim the media/privacy and acknowledgments sections; they are context, not core learning.
- Deep-read the middle chapters on types, statements, functions, modules, exceptions, and classes—these are the foundation everything later depends on.
- For type hinting and async, expect only light coverage; plan to supplement with web resources once fundamentals are solid.
【Coverage Limits】
The excerpts sampled here concentrate on the preface and early framing chapters; the core technical chapters on object types, statements, functions, modules, exceptions, classes, and advanced tools are only implied by the book's stated outline, not directly covered.
Excerpt 1
s are also available for most titles ( http://oreilly.com ). For more information, contact our corporate/institutional sales department: 800-998-9938 or corp...
X-specific content has been cut here to make room for new 3.X topics and address book size in general. Formally, this edition has been updated to be current...
e welcome, and this feedback is invaluable for book quality. But please keep it fact-based and civil. Posts on the errata list have been mostly constructive,...
l that allows programmers to get more done with less effort. It is explicitly optimized for speed of development —its simple syntax, dynamic typing, lack of...
education. It’s not just for one thing, it’s for everything. For a sampling of additional Python users and applications that’s hopefully more up to date than...
s and with far more tools than can possibly be covered here. For example, it’s also used in: Artificial intelligence (see PyTorch , TensorFlow , and Keras )...
usually must install a Python interpreter on your computer. You don’t need to install Python at this point unless you want to work along with the sole trivia...
tion. Strictly speaking, bytecode is an import optimization. Bytecode is saved in .pyc files only for files that are imported , not for the top-level files o...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Loading comments...
Reply to Comment
Edit Comment