Question: python programming, Task 1: Write a function median(list name) that takes a list of numbers as an argument and returns the median value. Your function

python programming,

python programming, Task 1: Write a function median(list name) that takes a

Task 1: Write a function median(list name) that takes a list of numbers as an argument and returns the median value. Your function should work for any list of numbers If there is an odd number of data values, the median will be the value in the middle of the sorted list. If there is an even number of data values, the median is the mean (or average) of the two data values in the middle of the sorted list. So,for the data set [1, 1, 2, 5, 6,6,91, the median is 5. For the data set [1, 1,2, 6, 6, 91, the median is 4. DO NOT assume that the list argument passed to your function will be in sorted order Tips: To sort a list: use the built-in Python function, sorted). Following is an example typed into the Python shell >>myList [5, 4, 10, 6, 7, 8,9,1, 2] >>sorted(myList) [1,2,4,5,6,7,8,9,10

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!