Part III: Which Brand Has the Worst Repair Record? (3 points) Write a function f
ID: 3812884 • Letter: P
Question
Part III: Which Brand Has the Worst Repair Record? (3 points) Write a function find worst brand() that searches a list of cars and returns the brand of car that has the worst repair record in terms of total repair costs. Since there might be several cars of the same brand, it will be necessary to sum the repair costs for all cars of each brand, determine which brand had the greatest total repair cost over all cars in the list, and finally, return the name of that brand. If two (or more) brands have the same maximum total repair code, the function can return either brand. Hint: consider using a dictionary, where the keys are brands and the values are the total costs for the brands. Another hint: to retrieve a list of the keys in a dictionary, you can use this syntax: my_dict = { } ...code that stores key/value pairs in my_dict... key_list = my_dict.keys() The idea then is to iterate over the list of keys, find the maximum value, and return the key for that maximum value. In the context of the find worst brand() function, finding the key with the largest value is equivalent to finding the brand with the highest total cost. Examples: Function Call Return Value find worst brand(cars1) "Honda" find worst brand(cars2) "Toyota" find worst brand(cars3) "Jeep"
Explanation / Answer
NOTE:
1) Please provide reset_car_database() function
2) please provide data set
then i will update the code according to that