§ 2.5section 10 of 18·~3 min
Control flow
Control flow decides which lines run, and how many times. Python marks blocks of code with indentation (4 spaces), not curly braces. The line that opens a block ends with a colon.
amount = 1299
if amount > 1000:
print("high value") # indented: inside the if
print("done") # not indented: always runs
OUTPUT
high value
doneThe next three sections cover making decisions, repeating work, and a compact way to build lists.