Exercise 9: Printing, Printing, Printing
By now you should realize the pattern for this book is to use more than one exercise to teach you something new. I start with code that you might not understand, then more exercises explain the concept. If you don’t understand something now, you will later as you complete more exercises. Write down what you don’t understand, and keep going.
What You Should See
Study Drills
- Check your work, write down your mistakes, try not to make them on the next exercise.
Common Student Questions
- Why do the \n newlines not work when I use %r?
- That’s how %r formatting works; it prints it the way you wrote it (or close to it). It’s the “raw” format for debugging.
- Why do I get an error when I put spaces between the three double-quotes?
- You have to type them like """ and not " " ", meaning with no spaces between each one.
- Is it bad that my errors are always spelling mistakes?
- Most programming errors in the beginning (and even later) are simple spelling mistakes, typos, or getting simple things out of order.