← Back to challenges

Bring Down the Class Average

PythonHardarraysmathnumbers

Instructions

What is the percentage you can score on a test, which singlehandedly brings down the class average by 5%? Given a list of your classmates scores, create a function that returns the answer. Round to the nearest percent.

Examples

take_down_average(["95%", "83%", "90%", "87%", "88%", "93%"]) ➞ "54%"

take_down_average(["10%"]) ➞ "0%"

take_down_average(["53%", "79%"]) ➞ "51%"

Notes

  • No tests will include empty lists or require negative percentages.
  • Note that you need to return a string.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.