Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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,10Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started