Part 1. Definition
In this task you are given a list of numbers and you need to find the average of each two consecutive values. The average of two numbers a and b is calculated as: (a + b) /2. The output should be a list of the averages of each two consecutive values. A list is presented with two brackets and comma-separated values, like: [1,2,3].
Part 2. Example
[-4, 7, 3]
Answer: [1.5, 5]
Explanation: To create the answer, we should first calculate the average of -4 and 7, that is: (-4 + 7 ) / 2 = 1.5, so the first element of the answer is 1.5. Then, we need to calculate the average of 7 and 3, that is: 5. So the second element of the answer is 5.
Part 3. Exercise
[-51, 1, -77, -80, 33, -42, 41, 86, -18, 58]
Answer:
[-25.0, -38.0, -78.5, -23.5, -4.5, -0.5, 63.5, 34.0, 20.0]