Question: 1. Create a function named get_count that: Has two parameters: data_list: a list of numeric values. update_count: an optional parameter with a default value of

1.

Create a function named get_count that:

Has two parameters:

data_list: a list of numeric values.

update_count: an optional parameter with a default value of False.

If update_count is True, this function should set the global count variable to the count of the input list data_list.

Returns the number of items of the data_list parameter.

2.

Create a lambda function that has one parameter for a list of numbers. The lambda should compute the average of all of the numbers in the list. Assign the lambda to the variable named fn_average.

Remember, to compute the average, you divide the sum by the count. You can use the built-in Python functions sum and len to compute the sum and get the length of a list, respectively. You've already seen the len function (e.g. len(my_list)).

Using the numbers list of lists, call the map function to compute the averages. The call to the map function should be using the numbers and fn_average variables as arguments.

numbers = [[1,2,3],[4,5,6]]

fn_average =

averages =

3.

Given the two lists list_a and list_b, use the map function to compute the product of the numbers of the lists. Store the results of the call to map in a variable named products.

The product is the result of multiplying numbers. For instance, if the input list were:

[1, 2, 3] [2, 3, 4] 

The result would be:

[2, 6, 12]

list_a = [4, 6, 8] list_b = [3, 3, 1]

products =[1, 2, 3]

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!