Appendix C. Answers to the Practice Questions

This appendix contains the answers to the practice problems at the end of each chapter. I highly recommend that you take the time to work through these problems. Programming is more than memorizing syntax and a list of function names. As when learning a foreign language, the more practice you put into it, the more you will get out of it. There are many websites with practice programming problems as well. You can find a list of these at

Chapter 1

  1. The operators are +, -, *, and /. The values are 'hello', -88.8, and 5.

  2. The string is 'spam'; the variable is spam. Strings always start and end with quotes.

  3. The three data types introduced in this chapter are integers, floating-point ...

Get Automate the Boring Stuff with Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.