
74 Introduction to Computational Mo de ls with Python
Figure 5.2 Example of selection s tructure.
The following e xample is a selection statement in P ython that includes a
compound condition.
if a < b or x >= y :
a = x + 23.45
else :
a = y
5.4 A COMPUTATIONAL MODEL WITH SELECTION
The following problem involves developing a computatio nal model that in-
cludes a quadra tic equation, which is a simple mathematical model of a second-
degree equation. The solution to the q uadratic equation involves complex
numbers.
5.4.1 Analysis and Mathematical Model
The goal of the solution to the problem is to compute the two roots of the equa-
tion. The mathematical