FunctionRacerProblemsRace

Percent of Total

BeginnerNumPyPython

sales holds how much each store sold (never negative, and the total is above 0). Return an array giving each store's share of the overall total as a percentage, so the results add up to 100.

Example 1

sales [1,3]
returns [25.0,75.0]

The total is 4, so the shares are 25.0 and 75.0.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems