Question: def find_lists_avg(list_of_lists): list_of_avgs = [] if len(list_of_lists) == 0: return None else: for l in list_of_lists: avg = float(sum(l))/len(l) list_of_avgs.append(avg) return list_of_avgs Write a function,

 def find_lists_avg(list_of_lists): list_of_avgs = [] if len(list_of_lists) == 0: return None

def find_lists_avg(list_of_lists): list_of_avgs = [] if len(list_of_lists) == 0: return None else: for l in list_of_lists: avg = float(sum(l))/len(l) list_of_avgs.append(avg)

return list_of_avgs

else: for l in list_of_lists: avg = float(sum(l))/len(l) list_of_avgs.append(avg) return list_of_avgs Writea function, find lists_avg(...), that computes the average of a list of

Write a function, find lists_avg(...), that computes the average of a list of numbers. The function accept one parameter, list_of_lists, from which you should extract each list and compute the average of the values in each list. You can assume that the values in the list are either integers or floats. The function should return a list of averages of the lists. Ex. list-of-lists [[1,2,3], [2,4], [3,3,3]] print(find_lists_avg(list_of_lists)) should output: [2.0, 3.0, 3.0]

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 Databases Questions!