Technical requirements
You can find the programs used in this chapter on GitHub at https://github.com/PacktPublishing/Practical-Computer-Architecture-with-Python-and-ARM/tree/main/Chapter05.
This chapter requires no new resources in addition to previous chapters. All that is required is a computer with a Python IDE. The same is true of all chapters until we reach Chapter 9, which deals with Raspberry Pi.
Statements and Expressions
An expression is a combination of values and operators that can be evaluated to provide a result; for example (p+q)*7 - r
. A Boolean expression is a combination of values and logical operators that yields the value True
or False
; for example, p >
q
.
A statement is a Python operation that must be evaluated by an interpreter; that is, it’s an action. Typical Python statements involve if
… for
… actions. These two terms are often used in formal definitions; for example, the definition of an if
statement is as follows:
if...