What you should know before reading this book
This is a learning experience, not a reference book. We deliberately stripped out everything that might get in the way of learning whatever it is we're working on at that point in the book. And the first time through, you need to begin at the beginning, because the book makes assumptions about what you've already seen and learned.
This book is designed to get you up to speed with Python as quickly as possible.
As you need to know stuff, we teach it. So you won't find long lists of technical material, no tables of Python's operators, not its operator precedence rules. We don't cover everything, but we've worked really hard to cover the essential material as well as we can, so that you can get Python into your brain quickly and have it stay there. The only assumption we make is that you already know how to program in some other programming language.
This book targets Python 3
We use Release 3 of the Python programming language in this book, and we cover how to get and install Python 3 in the first chapter. That said, we don't completely ignore Release 2, as you'll discover in Chapters 8 through 11. But trust us, by then you'll be so happy using Python you won't notice that the technologies you're programming are running Python 2.
We put Python to work for you right away.
We get you doing useful stuff in Chapter 1 and build from there. There's no hanging around, because we want you to be productive with Python right away.
The activities are NOT optional.
The exercises and activities are not add-ons; they're part of the core content of the book. Some of them are to help with memory, some are for understanding, and some will help you apply what you've learned. Don't skip the exercises.
The redundancy is intentional and important.
One distinct difference in a Head First book is that we want you to really get it. And we want you to finish the book remembering what you've learned. Most reference books don't have retention and recall as a goal, but this book is about learning, so you'll see some of the same concepts come up more than once.
The examples are as lean as possible.
Our readers tell us that it's frustrating to wade through 200 lines of an example looking for the two lines they need to understand. Most examples in this book are shown within the smallest possible context, so that the part you're trying to learn is clear and simple. Don't expect all of the examples to be robust, or even complete—they are written specifically for learning, and aren't always fully-functional.
We've placed a lot of the code examples on the Web so you can copy and paste them as needed. You'll find them at two locations:
http://www.headfirstlabs.com/books/hfpython/ and http://python.itcarlow.ie
The Brain Power exercises don't have answers.
For some of them, there is no right answer, and for others, part of the learning experience of the Brain Power activities is for you to decide if and when your answers are right. In some of the Brain Power exercises, you will find hints to point you in the right direction.
Selected Review Quotes
"Head First Python is a great introduction to not just the Python language, but Python as it's used in the real world. The book goes beyond the syntax to teach you how to create applications for Android phones, Google's App Engine, and more."
— David Griffiths, author and Agile coach
"Where other books start with theory and progress to examples, Head First Python jumps right in with code and explains the theory as you read along. This is a much more effective learning environment, because it engages the reader to do from the very beginning. It was also just a joy to read. It was fun without being flippant and informative without being condescending. The breadth of examples and explanation covered the majority of what you'll use in your job every day. I'll recommend this book to anyone starting out on Python."
— Jeremy Jones, coauthor of Python for Unix and Linux System Administration
"Head First Python is a terrific book for getting a grounding in a language that is increasing in relevance day by day."
— Phil Hartley, University of Advancing Technology