๐Ÿ PyQuest๐Ÿค” Making Decisions ยท ๐ŸŽข and / or: Double Checks
โญ 0 XP๐Ÿ Python is waking upโ€ฆ

and / or: Double Checks ๐ŸŽข

What if a decision depends on two things at once? Meet and and or.

and โ€” both sides must be True:

height = 145
has_ticket = True

if height >= 140 and has_ticket:
    print("Climb aboard! ๐ŸŽข")

Tall enough but no ticket? No ride. Ticket but too short? No ride. It takes both.

or โ€” only one side needs to be True:

day = "Saturday"

if day == "Saturday" or day == "Sunday":
    print("WEEKEND! ๐ŸŽ‰")

An easy way to remember: and is picky, or is generous.

Your mission

Build the gate for a rollercoaster!

  1. Make three variables: height (a number), has_ticket (True or False), and day (a day of the week, in quotes)
  2. Use and in an if to let riders on only when they're tall enough and have a ticket โ€” with an else for the ones who don't make it
  3. Then use a second if with or to print a bonus message when day is "Saturday" or "Sunday"

Your code

Press โ–ถ Run to see what your code does!