Preface
Welcome to Core Python Programming!
We are delighted that you have engaged us to help you learn Python as quickly and as in-depth as
possible. Learning the syntax is one goal of this book; however, we also believe that if you learn how
Python works under the covers, you won't just be able to program in Python, but you will write more
effective Python applications even as a beginner to the language. As you know, just because you learn a
language's syntax does not make you competent in it right away.
Throughout the book, you will find many examples that you can try right in front of your computer. To
hammer the concepts home, you will also find fun and challenging exercises at the end of every chapter.
These easy and intermediate exercises are meant to test your learning and push your Python skills.
There simply is no substitute for experience. We believe you should not only pick up Python
programming skills but also be able to master them in as short a time period as possible.
About This Book
This book differs from other Python books on the market by presenting a broad range of topics,
providing numerous examples, and going in-depth where necessary. This book does not require a
specific background such as prior knowledge of C or object-oriented programming. It is also not a large
case study book that does not facilitate picking up the language quickly. Finally, this book is not a pure
reference nor is it meant to be a quick "dive" into Python. What we have is an extremely comprehensive
introduction to the core features of the language (
Part I) followed by a set of chapters that delve into
specific areas of intermediate Python programming.
This book is 40 percent introductory, 40 percent intermediate to advanced, and 20 percent reference. It
is targeted toward technical professionals who are already familiar with programming in one other high-
level language, as well as university/college and secondary students. Because Python is used in larger
solutions such as Zope, Plone, MailMan, and Django, this book may be used by principals developing,
managing, maintaining, or integrating with those systems.
With regards to the code in this book, about a third of the first edition readers sent in complaints that
there were not enough large, full-fledged applications in the book, or that the code examples were not
long or comprehensive enough. Everyone else wrote that they loved the short, easy-to-understand
examples and were not bored of page after page of mind-numbing code. The philosophy behind more
short examples is to give you the ability to look at a piece of code and grasp its entirety. These turn into
building blocks to understanding and then can be incorporated into larger applications as well. There are
line-by-line explanations for most of the larger programs in the book. The abundant interpreter code
snippets scattered throughout the book are there for you to try on your computer as you are learning
Pythonuse the interactive interpreter as much as possible. You not only learn and improve your Python
from using it, but you can also benefit from working out bugs in your code before you paste it into your
source file.
Because you cannot learn Python well without practice, you will find the exercises at the end of every
chapter to be one of the greatest strengths of this book. They will test your knowledge of chapter topics
and definitions, as well as get you to code as much as possible. There is no substitute to learning a
programming language faster and more effectively than by building applications. You will find easy,
intermediate, and difficult problems to solve. It is also here that you may have to write one of those
"large" applications that many readers wanted to see in the book, but rather than having me do it, you
gain the most from such exercises.
Appendix A features answers to selected problems from each
chapter.