Question: Language is Python 3.6 4 HOMEWORK 02: FRUITFUL FUNCTIONS & CONDITIONALS th some of your favorite artists! There are prices for single tickets and you
4 HOMEWORK 02: FRUITFUL FUNCTIONS & CONDITIONALS th some of your favorite artists! There are prices for single tickets and you want to decide how you can attend as many concerts as Part 2: Concert Listing concert listing wi You come across a and group tickets (in packs of 10), possible with your given budget. The following functions help you achieve that goal Ade $152 Zac Brown Band $25 $200 Taylor Swift Group Tickets (10) s3eee Function name (1k is_single_cheaper Retun value: boolean Description Write a function that takes in the name of one of the artists from the chart. Decide whether or not it would be cheaper to buy a single ticket, or to get the group ticket price and divide it amongst 10 f it's cheaper for single tickets, then return True, and if not, then return False. If the artist is people. not valid, retum None. is-single-cheaper( "Taylor Swift") is-single-cheaper("Chainsmokers") True None Function name (2); best price Parameters artistName(str) Retum value; representing the best price the user would pay to attend the artist's concert (int) Description: Write a function that takes in the name of one of the artists from the chart. Using the s single_cheaper function, determine whether a single ticket or group ticket would be the cheapest, and then return the price of the ticket as an integer. the group option ends up being the cheapest, do not return the full price for the group, but the price once it is divided by 10 people. If the artist is not valid, return None. best-price("Taylor Swift") 275 best-price("Avic1") None Function name (3): all three Parameters None Return value; representing how much it would cost to attend all three concerts (int) Description: Write a function that uses the best price function to determine the best prices of each of the concerts, sums them all up, and returns the total cost
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
