Learning how to write functions in Python!
You are a given a list of numbers J
and a single number p
.
Write a function to return the minimum and maximum averages of the sequences of p
numbers in J
.
J = [4, 4, 4, 9, 10, 11, 12]
p = 3
The sequences will be:
(4, 4, 4)
(4, 4, 9)
(4, 9, 10)
(9, 10, 11)
(10, 11, 12)
The minimum average will be 4 and the maximum average will be 11, which corresponds to the first ande last sequences.