#Lab Assignment Dec 6 #Write a function process that has one parameter - list of integers. The #function finds and returns the following: average of all items in the #list, the number of items below average, the number of items above #average and the number of items equal to average. Write a program that reads the #size of the list and randomly generates the list of integers between -10 #and 10 (use function make_random_list to generate a list). The program #then uses function process to find the average of all elements in the #list, the number of items below average, above average and equal average #Note: this solution has an additional function average, and creates 3 lists import random def make_list_random(size, min_limit, max_limit): my_list=[] for i in range(size): n=random.randint(min_limit, max_limit) my_list.append(n) return my_list def average(my_list): return sum(my_list)/len(my_list) def process(my_list): ave=average(my_list) above=[] below=[] equal=[] for i in range(len(my_list)): if(my_list[i]>ave): above.append(my_list[i]) elif(my_list[i]< ave): below.append(my_list[i]) else: equal.append(my_list[i]) return ave, above, below, equal def main(): size=random.randint(5,15) my_list=make_list_random(size, -10, 10) print(my_list) ave, above, below, equal= process(my_list) print("average is", ave) if(len(above)>0): print("above average values", above) print("there are", len(above) ,"values above the average") else: print("no values above average") if(len(below)>0): print("below average values", below) print("there are", len(below) ,"values below the average") else: print("no values below average") if(len(equal)>0): print("there are", len(equal), "values equal to average in the given list") else: print("no values equal to average") main()