Chapter 7Flow Control

We’ve covered a lot of the basics, but this is where we really breathe life into our programs. Up to this point, our programs have been so flat and predictable. Each time we run them, we’ll get pretty much the same experience. I mean, if a program asks me for my name, I guess instead of “Chris,” I could say “Stud-chunks McStallion” (as they used to call me), but that’s hardly a new experience.

After this chapter, though, we’ll be able to write truly interactive programs. In the past, we made programs that said different things depending on your keyboard input, but after this chapter they will actually do different things. But how will we determine when to do one thing instead of another? We need…

Get Learn to Program, 2nd Edition 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.