Concept
if, elif and else choose which block runs from a condition that evaluates to true or false. Comparison and boolean operators build the condition.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Conditionals doing its job.
temperature = 31
if temperature >= 30:
advice = "stay in the shade"
elif temperature >= 20:
advice = "a good day for a walk"
else:
advice = "bring a jacket"
print(advice)Writing if x == 1 or 2. The second operand is just the number 2, which is always truthy, so the branch runs for every x. Write x == 1 or x == 2, or x in (1, 2).
Your roadmap puts these before Conditionals, unless you already know them.
Once a session shows you understand Conditionals, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.
Topics that build on Conditionals.