Question: Hello, I'm currently having some trouble executing the following code in Python. I'm working to execute a code which returns an average value out of

Hello,

I'm currently having some trouble executing the following code in Python. I'm working to execute a code which returns an average value out of a set list. I'm new to coding so I'm having a hard time understanding how to begin executing such code below. Please see parameters.

The name of the method should be avg_val and the method should take one parameter which is the list of values to test.

Here is an example call to the function

print(avg_val([19, 2, 20, 1, 0, 18]))

Implement function avg_val(lst), which returns the average

value of the elements in list.

For example, given a list lst: [19, 2, 20, 1, 0, 18], the function

should return 10.

My question is how would I begin to call the avg function method and execute this code. If somebody could possibly walk me through this I would greatly appreciate it. I have looked online to find a tutorial on this but cannto find one that explains the process.

Thank You!!!

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!