Question: Create a def named median that will take one argument ( a list of numbers ) , and returns the median of those numbers. Median

Create a def named median that will take one argument (a list of numbers), and returns the median of those numbers. Median is value in the center of a sorted list. Use the length to calculate the index of the middle item. If there are an even number of elements, return the greater of the two (you do not need to average them).
Calls the def four times and print out the results for the lists [3,1,2],[4,3,2,1],[1,5,3,2,4], and [6,5,1,2,3,4].

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!