Question: In Python Write a Python program which performs the following tasks: - (1) Define the avg function which has one parameter my_list. It calculates the

In Python

In Python Write a Python program which performs the following tasks: -

Write a Python program which performs the following tasks: - (1) Define the avg function which has one parameter my_list. It calculates the average value of the elements in the parameter my_list (a list object). The average value is returned. - (2) Define the main function which firstly creates a list with the following numbers as elements: 3,6,7,2,5,2,9,1,8,4. Then, it calls the avg function and pass over this list. The returned value will be printed in the main function. - (3) Execute the program by calling the main function

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!