Ticket Price Calculator

This challenge is decomposed into sub-functions on purpose, mirroring the lesson's five-step process. Complete all three functions: get_base_price(category) returns 12/6/8 for "adult"/"child"/"senior"; apply_group_discount(price, group_size) applies a 10% discount (returns price * 0.9) if group_size >= 4, otherwise returns price unchanged; calculate_total(category, group_size) combines both to return the total cost for the whole group, formatted to 2 decimal places.

main.py
Loading editor…

Console

Run your code to see output here.