About the Author Al Sweigart is a software developer tech book author and hoopy frood who really knows where his towel is He has written several programming books for beginners including Automate the Boring Stuff with Python and Scratch Programming Playground also from No Starch Press His books are freely available under a Creative Commons license at his website https inventwithpython com About the Technical Reviewer Ari Lacenski is a developer of Android applications and Python software She lives in the Bay Area where she writes about Android programming at http gradlewhy ghost io and mentors with Women Who Code
B R I E F CO N T E N T S Acknowledgments xix Introduction xxi Chapter 1 The Interactive Shell 1 Chapter 2 Writing Programs 11 Chapter 3 Guess the Number 21 Chapter 4 A Joke-Telling Program 39 Chapter 5 Dragon Realm 45 Chapter 6 Using the Debugger 63 Chapter 7 Designing Hangman with Flowcharts 77 Chapter 8 Writing the Hangman Code 87 Chapter 9 Extending Hangman 111 Chapter 10 Tic-Tac-Toe 121 Chapter 11 The Bagels Deduction Game 149 Chapter 12 The Cartesian Coordinate System 163 Chapter 13 Sonar Treasure Hunt 171 Chapter 14 Caesar Cipher 197 Chapter 15 The Reversegam Game 209 Chapter 16 Reversegam AI Simulation 239 Chapter 17 Creating Graphics 255 Chapter 18 Animating Graphics 273 Chapter 19 Collision Detection 285
Chapter 20 Using Sounds and Images 301 Chapter 21 A Dodger Game with Sounds and Images 311 Index 335 viii Brief Contents