Skip to content

Decisions · routine

Ticket price

Write ticket_price(age, student) for a cinema: under 12 or 65 and over pay 5, students (when student is True) pay 7, everyone else pays 10.

A child who is also a student still pays 5 — the cheapest price that applies.

Run adds print(ticket_price(8, False)) after your code, to try it.

Stuck on the idea rather than the code? The Combining conditions lesson walks through it.