×

python · level 1 · unit 4 · lesson 4

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

Build bigger questions with , and .

and links two conditions. It gives True only when both sides are True. A cake needs flour and eggs: if either one is missing, there is no cake.

or gives True when at least one side is True, like a lie-in on Saturday or Sunday. not flips an answer, so not True is False.

A box holding True or False already counts as a condition. So if not has_eggs: reads like plain English: if we do not have eggs.

has_flour = True
has_eggs = False
if has_flour and has_eggs:
    print("Time to bake a cake!")
if not has_eggs:
    print("Off to the shop for eggs.")

Write a full condition on each side, like day == "Saturday" or day == "Sunday".