Computer programs are made up data structures that use conditions and decisions to bring the desired outputs. We will use Python notation here, as it is simple, and you may have seen it before. The basic data structures are as follows.
- Iterators such as while loops and for loops. An iterator loops as many times as it is told to, running other commands each time it goes around.
- Decision points such as if structures and case structures. The previous diagram is of a set of nested if structures.
Boolean operators |
||
Notation |
Description |
Examples |
X == Y |
X is equivalent to Y. This is not always a numeric value set. |
"shirts" == "hats" evaluates to FALSE. "shirts" == "shirts" evaluates to TRUE. 1 == 11 evaluates to FALSE. 11 == 11 evaluates to TRUE. |
X != Y |
X is not equivalent to Y. |
"... |