Ticket Checker
Python
15 pts
Ticket Checker
A youth concert in Asmara has rules for tickets. Given age = 16, money = 100 and ticket_price = 80, create three boolean variables using comparisons:
is_teen—Truewhen age is from 13 to 19 (use a chain).can_afford—Truewhen money is at least the ticket price.exact_change—Truewhen money is exactly the ticket price.
Print the three variables in that order. Expected output:
True True False
Checklist
- Keep the given values and create
is_teenwith a chained comparison (13 to 19). - Create
can_afford: whethermoneyis at leastticket_price. - Create
exact_change: whethermoneyis exactlyticket_price. - Print the three variables, one per line.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
