A theme park lets someone on the roller coaster when they are at least 6 years old and either at least 140 cm tall, or at least 120 cm tall and accompanied by an adult. Write can_ride(height_cm, age, with_adult) that returns True or False.
Examples
Input: height_cm = 150, age = 10, with_adult = False
Output: True
Input: height_cm = 125, age = 8, with_adult = False
Output: False
Input: height_cm = 125, age = 8, with_adult = True
Output: True
Constraints
50 <= height_cm <= 2500 <= age <= 120with_adultis a boolean
Goals
- Mix and, or and not in one decision
- Apply a rule that blocks every other rule