Best average over k days

Write max_average(nums, k) that returns the largest average of any k consecutive values, as a float. The list has at least k values.

max_average([1, 12, -5, -6, 50, 3], 4)  ->  12.75     ((12 - 5 - 6 + 50) / 4)
max_average([5], 1)                     ->  5.0

The point is to practise a fixed-size sliding window. One check has a hundred thousand values with k of fifty thousand; recomputing each window's sum will not finish.

def max_average(nums, k):
    ...