Due 10/14 at 11:59
Theme parks use rules to decide who can ride each attraction. Some rides require a minimum height and age. Others let shorter guests ride if they are with an adult.
Write a program that asks the user a few questions and tells them which rides they are allowed to ride. Your program must meet the following specifications:
yes or no)if statements and logical operators (and, or, not)| Ride | Rule |
|---|---|
| Mini Coaster | At least 8 years old and at least 42 inches tall |
| Big Drop | At least 12 years old and at least 54 inches tall |
| River Rapids | At least 48 inches tall or with an adult |
For example, a 10-year-old who is 50 inches tall and not with an adult should be able to ride the Mini Coaster and River Rapids, but not the Big Drop.
Use and when all conditions must be true:
if age >= 8 and height >= 42:
print("You can ride the Mini Coaster!")
Use or when at least one condition must be true:
if height >= 48 or with_adult == "yes":
print("You can ride River Rapids!")
Here is a starting point. Fill in the TODO comments to meet the specifications above!
# Ask the user for their age and height
age = int( input("How old are you? ") )
height = int( input("How tall are you (in inches)? ") )
# Ask the user if they are with an adult
with_adult = input("Are you with an adult? (yes/no): ")
# Check eligibility for each ride
# TODO: Mini Coaster
# TODO: Big Drop
# TODO: River Rapids
notWhen you’re happy with your ride checker, download the .py file and submit it on Thinkwave.