Answered step by step
Verified Expert Solution
Question
1 Approved Answer
As you examine the bridges more closely, you'll notice that each one has a sign with some numbers. You assumed these are the number of
As you examine the bridges more closely, you'll notice that each one has a sign with some numbers. You assumed these are the number of people who have safely crossed each bridge. So you want to calculate the average and pick the bridge with the highest number. Again, you want to be wise about it and you will find an average without minimum and maximum value. Very often, it is useful to split a problem into smaller problems and solve them one by one. Question : Write a function that takes a nonempty list of a number of people who crossed a bridge and calculates the average for the given list according to our definition of the average above. Round the number to the second decimal place and return your answer. If the length of the list is less than or equal to two, then return Hints: min max might be useful sum might be useful Use round builtin function. Input Output Reason Drop minimum and maximum The average is Rounded to the second decimal place is def averagewithoutminmaxpeople: averagewithoutminmax averagewithoutminmax averagewithoutminmax
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