Skip to main content
Top

Hint

Swipe to navigate through the chapters of this book

2019 | OriginalPaper | Chapter

6. Flow of Control Using If Statements

share
SHARE

Abstract

In this chapter we are going to look at the if statement in Python. This statement is used to control the flow of execution within a program based on some condition. These conditions represent some choice point that will be evaluated to True or False. To perform this evaluation it is common to use a comparison operator (for example to check to see if the temperature is greater than some threshold). In many cases these comparisons need to take into account several values and in these situations logical operators can be used to combine two or more comparison expressions together.
Metadata
Title
Flow of Control Using If Statements
Author
John Hunt
Copyright Year
2019
DOI
https://doi.org/10.1007/978-3-030-20290-3_6

Premium Partner