Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


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.0.

  • 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

Subscriber Reviews

Average Rating: 4.073170731707317 out of 5 rating Based on 41 Ratings

"Lots of good detail, needs some aggressive editing" - by AssignableWorkUnit456 on 12-JUN-2013
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
This book contains some great info.  It is possible to learn python by using it... but it feels overly long/wordy.  There is a very high incident of repetition of information - not just in summary sections.

I think the problem comes from the focus of the book being a combination of people new to programming, people new to object oriented software, and programmers that are more experienced.

As an experienced (scripting and non scripting) developer I opted for the reading it cover to cover strategy as in between the sections of "how to type your name" there is some genuinely important info.  

I'm sure there are better books for experienced developers.

Report as Inappropriate

"Learning Python, 4th Edition" - by brian.k.martin on 14-JAN-2013
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
After reading some of the reviews I decided to use this book as my first choice for a foray into Python. I ignored the one "bad" review that mentioned how infuriating the book was. I should have listened!

I am a longtime reader and user of O'Reilly books. Usually they are tops in terms of quality of writing, completeness, and ease of use. This book is some type of aberration, though. It's actually very tough to use for a newbie. Literally, you don't get into anything that even approaches programming until CHAPTER 10. That's page #263 out of 1162 pages! This is ridiculous... absolutely maddeningly ridiculous.

Typically when O'Reilly puts out a book like this there's a brief "Learning" guide, a more in-depth, very thick "Programming" guide, and a "Quick Reference". The Learning PERL guide is super easy to read and tremendously useful. The Programming PERL text is appropriately deep and detailed. Likewise, the Quick Reference is brief and to the point. However, the Learning PYTHON guide is a mess. If I'm trying to learn how to use a new programming language (one that is supposedly the end-all-beat-all) then I don't want to read through 50 pages of different ways to LAUNCH a program... followed by 120 more pages of the 10,000 different ways I can make a string or a number. I mean, WHO IN THE HECK WROTE THIS?

I realize Mark Lutz is supposed to be the grand wizard of Python but if this is the best he's got, he needs to stick to programming and leave the writing and teaching to someone with the chops to do it.

Sorry... but I absolutely cannot recommend this book. It's terribly paced, overly detailed, painfully frustrating to read. What's worse... it failed at it's primary goal of teaching me Python. It fails not by lack of information... but because by the time it finally gets around to showing you how to DO anything productive, you no longer CARE to continue reading. It squanders the reader's excitement for learning a new language and burns that goodwill going through mind-numbing minutiae instead to the point that you'd just rather toss the book and try something else. I'm going to try Head First Python and  the Core Python Programming book recommended by another user instead. Maybe they'll dispense with the scholarly dissection of relatively trivial nonsense and get down to showing me how to use the language.

Report as Inappropriate

"Excellent" - by Anonymous on 25-NOV-2012
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
concise and well written
Report as Inappropriate

"There are better out there" - by Anonymous on 10-JUN-2012
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
Do yourself a favor. Read Core Python Programming, by Wesley Chun instead. It covers more material in a well explained, yet more concise manner.

"Learning Python" really drags. As an experienced software engineer I know I'm not the intended audience for this, but I am new to to python and wanted some basic programming excersizes to learn from as well some some easy to find/concise syntax info. Practice excersizes seem ok (so this is on my 10-shelf this month). Layout not very good as a reference or to skim over. If you have to pick just one definately pick the W.Chun book.

Report as Inappropriate

"Get this book" - by curtvprice on 17-AUG-2012
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
This book is awesome, especially for someone like me who is not a full time developer and needs to dive in to programming occasionally and have a reference. (The pocket references are okay, but often not enough to get me back up to speed.)
Report as Inappropriate

Table of Contents



The publisher has provided additional content related to this title.


Visit the catalog page for Learning Python, 4th Edition

  • Catalog Page

Visit the errata page for Learning Python, 4th Edition

  • Errata

Download the supplemental electronic content for Learning Python, 4th Edition

  • Supplemental Content