Ticket price
Ticket price
Read age with int(input()), then read yes or no for membership: member = input() == "yes" stores True or False. Members pay 5. Everyone else pays 12, or 8 if they are under 18. Print the price.
Order matters: test member first, so a 12-year-old member still pays 5. An 18-year-old is not under 18.
A True/False variable needs no comparison: if member: already asks the question. Writing if member == True: works too, but the short form is what you will see in real code.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Read age with int(input()), then read yes or no for membership and store member = input() == "yes". Members pay 5. Everyone else pays 12, or 8 if they are under 18. Print the price.
Click Run to see the output here.