Python_4_023216
Python_4_023216
Selection Statements
Wadhah S. Sebti
Selection
Selection: if and if-else Statements
In this section, we explore several types of selection statements, or
control statements, that allow a computer to make choices.
Yet another way to describe this situation is to say that if the number is
greater than or equal to 0 and less than or equal to 100, then we want the
program to perform the computations and output the result; otherwise, it
should output an error message. The logical operator and can be used to
construct a different compound Boolean expression to express this logic:
Selection
Logical Operators and Compound Boolean Expressions
else: