FunctionRacerProblemsRace

Weighted Average

EasyNumPyPython

A course grade counts each assignment by its weight. Return the weighted average: the sum of grades[i] * weights[i] divided by the sum of the weights. Return a float.

Example 1

grades [80,100]
weights [1,3]
returns 95.0

(80 * 1 + 100 * 3) / 4 = 95.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