5 Making decisions in programs

Image

What you will learn

I’ve described a computer as like a sausage machine that accepts an input, does something with it, and then produces an output. This is a great way to start thinking about computers, but a computer does a lot more than that. Unlike a real-life sausage machine, which simply tries to create sausage from anything you put in it, a computer can respond to different inputs in different ways. In this chapter, you’ll learn how to make your programs respond to different inputs. You’ll also learn about the responsibility that comes with making the computer work in this way because you must be sure that ...

Get Begin to Code with Python 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.