What You Learned

These problems were pretty simple, but hopefully they got you thinking about keeping input, processing, and output separate. When programs are simple, it’s tempting to just do some math or string concatenation inside the program’s output statements, but as your programs get more complex, you’ll find you need to break things into reusable components. You’ll be glad you were disciplined from the start.

Head on over to the next chapter. It’s time to do some more serious math.

Get Exercises for Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.