Good place to stop if you're short on time — step 3 picks up here.
Lesson idea Tap to fold
Without scrolling back — in an elif chain, if the first condition is True, does Python still check the rest?
Show the answer
Answer. No. It stops at the first True branch and skips everything after it, even if a later condition would also be True.
And from further back — what does = actually do in frame_count = 240?
Show the answer
Answer. It puts 240 into the box labelled frame_count. Right side into left side, never the other way.
and, or, and not combine yes/no boxes
So far every decision has checked one boolean at a time. A delivery gate rarely works that way — a shot only clears final delivery if resolution AND duration both check out. Either one failing is enough to hold it.
# Two yes/no facts
resolution_ok = True
duration_ok = False
# Both must be True, or either one
print(resolution_ok and duration_ok)
print(resolution_ok or duration_ok)
and needs both sides True to be True — one failure sinks it. or only needs one side True — it's more forgiving. not is different again: it takes one boolean and flips it, True becomes False and back.
Pick and when a pass requires everything to hold. Pick or when any one thing is enough. "Needs a retake" and "is ready to deliver" are usually opposites of each other, not independent checks — which is exactly where not earns its keep: not (resolution_ok and duration_ok) reads as "not fully passing," without writing the failure logic out a second time.
Worth knowing, not needed today: Python only checks the second side of and/or when it has to. If the left side of and is already False, it never bothers looking at the right side — the answer's already decided.
That is the whole idea for today. and for "both," or for "either," not to flip a single boolean.
Predict, explain, then test
These three short checks are self-reviewed, not a quiz score. The code checks below rerun your rule on changed inputs and boundaries. They keep your named input facts and check your rule, not one required quote style.
Predict both rules
For audio_ok False and video_ok True, what are audio_ok and video_ok, and audio_ok or video_ok?
Compare your answer · self-reviewed
False, then True. Both do not pass, but at least one does.
Explain review
What does not (audio_ok and video_ok) mean?
Compare your answer · self-reviewed
Review is needed whenever the complete two-part pass rule is False. Only two True inputs avoid review.
Debug precedence
Does not audio_ok and video_ok express the same review rule?
Compare your answer · self-reviewed
No. It negates audio only, then combines that with video. With both False it returns False, even though the shot needs review.
Choose an exercise to load its prompt.
Today's idea in two other voices, if you want one. Not required — the exercises above are the actual lesson.
- Using the "and" Boolean Operator in Python — article, Real Python
- Python Tutorial for Beginners 6: Conditionals and Booleans — video, Corey Schafer
Loading exercises…
Noted on your route map, with the step you were on. Nothing is lost by parking it — the next review day will bring this idea back, and the flag tells the course where to slow down.
The tutor mounts here when JavaScript is available. The lesson above stays readable without it.