3GUESSING AND CHECKING WITH CONDITIONALS
“Put your dough into the oven when it is hot: After making sure that it is in fact dough.” —Idries Shah, Learning How to Learn
In almost every program you write for this book, you’re going to instruct the computer to make a decision. You can do this using an important programming tool called conditionals. In programming we can use conditional statements
like “If this variable is more than 100, do this; otherwise, do that” to check whether certain conditions are met and then determine what to do based on the result. In fact, this is a very powerful method that we apply to big problems, and it’s even at the ...
Get Math Adventures 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.