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,

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
Get step-by-step solutions from verified subject matter experts
