
C H A P T E R 5
The Selection Program
Structure
5.1 INTRODUCTION
In the previous chapter, it was discussed that to completely des cribe an al-
gorithm, four design structures are used: sequence, selection, repetition, and
input/output. This chapter e xplains the selection program structure using
pseudo-code, flowcharts, and the corresponding statements in the Python pro-
gramming language for implementing computational models.
Conditions are expressions that evaluate to a truth value (True or False).
Conditions are used in the selection statements. Simple conditions ar e formed
with relational operators for comparing two data items. Compound conditions ...