Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

for function(4) cheapest_concert, you CAN NOT use built in Python functions to sort please leave a simple answer for functions not something complicated considering I

image text in transcribed

image text in transcribed

for function(4) cheapest_concert, you CAN NOT use built in Python functions to sort

please leave a simple answer for functions not something complicated considering I am a beginner at Python

Thank You :)

HOMEWORK 02: FRUITFUL FUNCTIONS& CONDITIONALS 4 Part 2: Concert Listing You come across a concert listing with some of your favorite artists! There are prices for single tickets and group tickets (in packs of 10), and you want to decide how you can attend as many concerts as possible with your given budget. The following functions help you achieve that goal. Taylor Swift $275 Adele $152 $1500 Zac Brown Band $25 $208 Single Tickets Group Tickets (18) $3880 Function name (1: is single_cheaper Parameters; artistName(str) Return 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 people. If it's cheaper for single tickets, then return True, and if not, then return False. If the artist is not valid, return None. list: is-single-cheaper(Taylor Swift") is-single-cheaper("Chainsmokers") True None Function name (2): best_price Parameters; artistName(str) Return 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 is 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. If 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. Test Cases (not an exhaustive list: best-price( "Taylor Swift") best-price("Avicii") None 275 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

Where those not participating, encouraged to participate?

Answered: 1 week ago

Question

3. Who would the members be?

Answered: 1 week ago