Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Once you tested your function for a single list, you can re - use it to solve the original problem. This time you are given
Once you tested your function for a single list, you can reuse it to solve the original problem. This time you are given a people list of nonempty lists, where each list represents different bridges and a number of people crossed it You are also given a list of names of the bridges corresponding to the list of people. Write a function that outputs a name of the bridge with the highest average as described above You can assume that the lengths of both lists are the same. Special instructions: If there is a tie, return the highest average that appears first. In case of an empty list, return No bridges to choose from If all the bridges have average rating treat as the best rating and return the first route. Hints: You should reuse the function from Question max will be helpful The lists index might be helpful look up the documentation! The function should work with any number of bridges. def bestaveragebridgepeople bridges: Finds the best bridge name based on the average ratings names flames "river" bestaveragebridgeratings names 'river' ratings names flames "flower", "river" bestaveragebridgeratings names 'flower' ratings names flames "flower", "river" bestaveragebridgeratings names 'flames' bestaveragebridgeNo bridges to choose from'
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started