A HANDS-ON, PROJECT-BASED
INTRODUCTION TO PROGRAMMING
PY THON
C R ASH COURSE
2ND EDITION
ERIC MATTHES
SHELVE IN:
PROGRAMMING LANGUAGES/
PYTHON
$39.95 ($53.95 CDN)
LEARN PYTHON—
FAST!
COVERS PYTHON 3.X
Python Crash Course is the world’s best-selling guide
to the Python programming language. This fast-paced,
thorough introduction to programming with Python will
have you writing programs, solving problems, and
making things that work in no time.
In the first half of the book, you’ll learn basic program-
ming concepts, such as variables, lists, classes, and
loops, and practice writing clean code with exercises
for each topic. You’ll also learn how to make your
programs interactive and test your code safely before
adding it to a project. In the second half, you’ll put
your new knowledge into practice with three substantial
projects: a Space Invaders–inspired arcade game, a
set of data visualizations with Python’s handy libraries,
and a simple web app you can deploy online.
As you work through the book, you’ll learn how to:
• Use powerful Python libraries and tools, including
Pygame, Matplotlib, Plotly, and Django
• Make 2D games that respond to keypresses and
mouse clicks, and that increase in difficulty
• Use data to generate interactive visualizations
• Create and customize web apps and deploy them
safely online
• Deal with mistakes and errors so you can solve your
own programming problems
This updated second edition has been thoroughly revised
to reflect the latest in Python code and practices. The
first half of the book includes improved coverage of
topics like f-strings, constants, and managing data. In the
second half, the code for the projects has been updated
with better structure, cleaner syntax, and more popular
and up-to-date libraries and tools, like Plotly and the
latest version of Django. (For a full list of updates, see
the Preface.)
If you’ve been thinking about digging into programming,
Python Crash Course will get you writing real programs
fast. Why wait any longer? Start your engines and code!
ABOUT THE AUTHOR
Eric Matthes is a high school science, math, and program-
ming teacher living in Alaska. He has been writing
programs since he was five years old and is the author
of the Python Flash Cards, also from No Starch Press.
www.nostarch.com
THE FINE ST IN GEEK E N TERTAIN M E NT
™
“I LIE FLAT.”
This book uses a durable binding that won’t snap shut
FSC FPO
WORLDWIDE
BEST SELLER
OVER 500,000
COPIES SOLD
WORLDWIDE
BEST SELLER
OVER 500,000
COPIES SOLD
WORLDWIDE
BEST SELLER
OVER 500,000
COPIES SOLD
WORLDWIDE
BEST SELLER
OVER 500,000
COPIES SOLD
PYTHON CRASH COURSE
MATTHES
2ND EDITION