Chapter 8
Making Decisions
IN THIS CHAPTER
Using the if statement to make simple decisions
Making advanced decisions using if…else
Nesting statements
The ability to make a decision, to take one path or another, is an essential element of performing useful work. Math gives the computer the capability to obtain useful information. Decisions enable you to do something with the information after obtaining it. Without the capability to make decisions, a computer would be useless. So any language you use will include the capability to make decisions in some manner. This chapter explores the techniques that Python uses to make decisions. You can find the downloadable source code for this chapter in the BPPD_08_Making_Decisions.ipynb
file, as described in the book's Introduction.
Get Beginning Programming with Python For Dummies, 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.