Google and YouTube use Python because it's highly adaptable, easy to maintain, and allows for rapid development. If you want to write high-quality, efficient code that's easily integrated with other languages and tools, this hands-on book will help you be productive with Python quickly -- whether you're new to programming or just new to Python. It's an easy-to-follow self-paced tutorial, based on author and Python expert Mark Lutz's popular training course.
Each chapter contains a stand-alone lesson on a key component of the language, and includes a unique Test Your Knowledge section with practical exercises and quizzes, so you can practice new skills and test your understanding as you go.
You'll find lots of annotated examples and illustrations to help you get started with Python 3.
Learn about Python's major built-in object types, such as numbers, lists, and dictionaries
Create and process objects using Python statements, and learn Python's general syntax model
Structure and reuse code using functions, Python's basic procedural tool
Learn about Python modules: packages of statements, functions, and other tools, organized into larger components
Discover Python's object-oriented programming tool for structuring code
Learn about the exception-handling model, and development tools for writing larger programs
Explore advanced Python tools including decorators, descriptors, metaclasses, and Unicode processing
About the Author
Mark Lutz is the world leader in Python training, the author of Python's earliest and best-selling texts, and a pioneering figure in the Python community since 1992. He is also the author of O'Reilly's Programming Python, Python Pocket Reference, and Learning Python (all in 4th Editions). Mark can be reached on the web at www.rmi.net.
Table of Contents
Getting Started
Chapter 1 A Python Q&A Session
Chapter 2 How Python Runs Programs
Chapter 3 How You Run Programs
Types and Operations
Chapter 4 Introducing Python Object Types
Chapter 5 Numeric Types
Chapter 6 The Dynamic Typing Interlude
Chapter 7 Strings
Chapter 8 Lists and Dictionaries
Chapter 9 Tuples, Files, and Everything Else
Statements and Syntax
Chapter 10 Introducing Python Statements
Chapter 11 Assignments, Expressions, and Prints
Chapter 12 if Tests and Syntax Rules
Chapter 13 while and for Loops
Chapter 14 Iterations and Comprehensions, Part 1
Chapter 15 The Documentation Interlude
Functions
Chapter 16 Function Basics
Chapter 17 Scopes
Chapter 18 Arguments
Chapter 19 Advanced Function Topics
Chapter 20 Iterations and Comprehensions, Part 2
Modules
Chapter 21 Modules: The Big Picture
Chapter 22 Module Coding Basics
Chapter 23 Module Packages
Chapter 24 Advanced Module Topics
Classes and OOP
Chapter 25 OOP: The Big Picture
Chapter 26 Class Coding Basics
Chapter 27 A More Realistic Example
Chapter 28 Class Coding Details
Chapter 29 Operator Overloading
Chapter 30 Designing with Classes
Chapter 31 Advanced Class Topics
Exceptions and Tools
Chapter 32 Exception Basics
Chapter 33 Exception Coding Details
Chapter 34 Exception Objects
Chapter 35 Designing with Exceptions
Advanced Topics
Chapter 36 Unicode and Byte Strings
Chapter 37 Managed Attributes
Chapter 38 Decorators
Chapter 39 Metaclasses
Appendixes
Appendix Installation and Configuration
Appendix Solutions to End-of-Part Exercises
Colophon