Ordering & Controlling Statements in Code
How to Structure Control Flows in Python
print(type(int("2")))
IF
function in Excel and the CASE
statement in SQL (but remember that indentation matters in Python).Python - Control | SQL - CASE | Excel - IF |
---|---|---|
if x = 2: |
CASE WHEN x > 2 |
IF(x > 2, |
y = 1 |
THEN 1 |
1, |
else: |
ELSE |
|
y = 0 |
0 END |
0) |
True
(1) or False
(0) is Boolean.Iterability is the ability to split an object into discrete items. The item may be ordered or unordered, each item will be extracted, processed ad set aside.
In general if an object can be split into multiple items it can be iterated (integers and floats are not iterable).
Iterable objects include:
Code Flow Structures in Action
For comparison, this is the equivalent SQL CASE statement.
Contact:
Code & Slides:
… And don’t forget to give us your feedback.
SAT // Intro to Control Flow // August 2025