Hey, thanks for buying the MEAP edition of Tiny Python Projects! This is as close to an “interactive” book as I could make. You see, I want you to be actively involved in learning how to write Python really well by using a process called “test-driven development” (TDD). So, really, you’ll learn two things from this book: how to write Python, and how to use and write tests for your code.
The first chapter describes how to structure a Python program into discrete functions, one of which is dedicated to getting command-line arguments and producing documentation for your program. The rest of the chapters each describe a coding challenge and the tests that have been provided in a Git repository so that you can try your hand at writing code and using the TDD process. Each chapter is dedicated to some central idea, like how to manipulate a string or list, when and how to use a dictionary, how to use random events, how to write functions and algorithms, etc. As the programs get more complex, I encourage you to write your own functions and the tests for them so that you learn how to become a self-sufficient tester.