Lab 8.2c - Can I or Can't I
In your editor (main.py)
Complete the following coding challenge:
Create a "Can I ride the roller coaster?" program. It will check to see if the user meets the minimum requirements to ride the roller coaster. Have the user input the information needed.
Requirements to ride the roller coaster:
Height over 50 inches – loophole allows any height if older than 18
Each ride costs 4 quarters.
There is a frequent rider pass, which makes the rides only cost 2 quarters.
Print True
if the user can ride the roller coaster, and False
if not.
Bonus
Are the following expressions equivalent? Research DeMorgan's Laws and write why you think they are the same or why they are not the same. Submit your answer in Google Classroom Lab 8.2a.
not(x or y) == not x and not y
not(x and y) == not x or not y
Last updated
Was this helpful?