Question: Create a function called get_average that takes one argument: mylist and returns the average of the elements in mylist Function argument: This function takes one

Create a function called get_average that takes one argument: mylist and returns the average of the elements in mylist

Function argument: This function takes one argument named mylist.

What does it do?: This function filters out the non-number elements in mylist and then compute the average of the remaining number elements.

What it returns?: Returns the average of the numbers in mylist.

For instance,

mylist = ['alpha', 500, 'zeta', 1000] get_average(mylist)

should return

750

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 General Management Questions!