Question
I NEED HELP WITH THIS WRITTEN IN PYTHON 3
Test cases:(for second function)
>>> total_buy_dict = buy_albums({"Coloring Book" : “Chance the Rapper”, "Acid Rap" : “Chance the Rapper”, "The College Dropout" : “Kanye West”, “Yeezus” : “Kanye West”, “My Beautiful Dark Twisted Fantasy” : “Kanye West”, “Channel Orange” : “Frank Ocean”, "Blonde" : “Frank Ocean”, "Kauai" : “Childish Gambino”, “Continuum” : “John Mayer”}, {“Chance the Rapper” : 0.00, “Kanye West” : 9.75, “Frank Ocean” : 12.15, “Childish Gambino” : 8.45, “John Mayer” : 4.75})
>>> print(total_buy_dict)
>>> {'Chance the Rapper': 0.00, 'Kanye West': 29.25, 'Frank Ocean': 24.30, 'Childish Gambino': 8.45, 'John Mayer': 4.75 'total': 66.75}
CS1301 HOMEWORK 07: INTRO TO DICTIONARIES Function name: scheduler Parameters: a dictionary containing members' names as keys, and lists of months that member is available as values Retuns: the best month to schedule the meet-up (str) Description: You're the event manager of the National Association of Python Coders, and you want to coordinate a big meet-up for your organization. Write a function called scheduler that takes in a dictionary with members' names as keys and lists of months during which the member is available to attend a meet-up, and returns whichever month has the most club members available. If there is more than one month with the highest number of available club members, return the month that occurs earlier in the year. NOTE: The list of months for each club member will contain integers 1-12; you should return the corresponding month name as a string ("January", "February", "March", etc.) Hint: It may be useful to use a dictionary for this step Test cases >>> info, dict-1 ("Andrew Andrews": [1,4,7,8], "Brock Brockson": [1,6,8,12], "Charles Charleston": [1,2,3], "David Davidson": [1,5,9,10], "Ellen Ellenson": [1] >>> scheduler(info_dict 1) January [4,5,6,3], Johnson": >>> info-dict-2 = {"Flora Flores". [4, 5, 6, 3], "George Georges": "Henry Henries": [4,5,6,3], "Isabella Isbell": [4,5,6,3], "John [4,5,6,3]] >>>scheduler(info dict_2) March Function name: buy albums Parameters: a dictionary named album_buy_ dict (key is the name of an album (string): value is a the album's artist (string), a dictionary named artist_price_dict [key is name of an artist (string): value is the price per album of all that artis's albums (float)) Returns: a dictionary key is the name of an artist (string): value is how much was paid in total for all of the albums we bought that were theirs (float)) Description: Write a function that takes in a dictionary in which every key is the name of an album, and every is a string of the name of the album's artist, as well as a dictionary in which every key is an artist's name, and every value is a float of the price per album for that artist for all their albums. The function should return a dictionary in which every key is the name of an artist whose album(s) you bought, and the value is the total amount you paid for the album(s) of that particular artist (i.e. price per that artist's albums total number of albums bought). The dictionary should also have a key-value pair where the key is "total" and the value is the grand total for all of the albums you bought. Authors: Christine Feng and Rodrigo Mejia
Explanation / Answer
# as the functions are unrelated questions, only the first complete question has been answered.
#----------- CODE ----------------#
#-------------- OUTPUT ---------------------------#