Question: #This problem will make use of the TheaterTicket class you wrote #in Problem 1 . You can copy / paste it into this problem if

#This problem will make use of the TheaterTicket class you wrote
#in Problem 1. You can copy/paste it into this problem if you want
#to, but you don't need to. When you click Submit, your code will
#be tested with our TheaterTicket class.
#
#Write a function called find_best_ticket. find_best_ticket should
#have three parameters: a list of available tickets (a list of
#instances of the TheaterTicket class), a quantity (an integer),
#and a budget (an integer).
#
#find_best_ticket should return the price of the most expensive
#tickets available from the list that is less than or equal to
#the given budget for the given quantity of tickets. If there are no
#available tickets that come under the budget for the given quantity,
#find_best_ticket should return False.
#
#As a reminder, every instance of TheaterTicket has a method called
#get_ticket_price. get_ticket_price has one parameter, a quantity.
#get_ticket_price returns the cost of the given quantity of that
#ticket. For example, if quantity is 5 and budget is 500, then the
#function would return the largest number to result from calling
#get_ticket_price(5) from each instance in the list of TheaterTicket.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!