Question: Question 1 ( 1 0 points ) : Write a short python function to find out the average of three consecutive items in an input

Question 1(10 points): Write a short python function to find out the average of three consecutive items
in an input list. The input of this function is a list of integer/ fractional values, and the function should
return a list of integer/ fractional values. The first item (index 0) in the output list would be the average
value of the first three items (index 0 to 2) of the input list, the second item (index 1) in the output list
would be the average value of the second three items (index 3 to 5) of the input list. For simplicity, assume
that the number of items in the input list will always be multiple of three. Write a main function to test
your function and print the output. Test with following examples at least.
Example 1: Input =[1,2,7,4,5,10], and output =[3.33,6.33]
Example 2: Input =[5.5,6,8], and output =[6.5]
Example 3: Input =[], and output =[]
Question 2(10 points): Find out the big-oh notation of your developed algorithm in question 1. Also,
describe your reasoning and steps throughout the process.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!