Nov-23-2020, 12:16 AM
def median(numbers):
"""Find the median of the given list of numbers.
How to find the median:
https://www.mathsisfun.com/median.html
Note: Write your own implementation and do not use any libraries. You will need to sort the list.
params:
numbers (list) A list containing either int or float elements
return (numeric) The median value as either an int or float
"""
if len(numbers)%2==0:
pass
else:
return numbers[len(numbers)//2-1]
"""Find the median of the given list of numbers.
How to find the median:
https://www.mathsisfun.com/median.html
Note: Write your own implementation and do not use any libraries. You will need to sort the list.
params:
numbers (list) A list containing either int or float elements
return (numeric) The median value as either an int or float
"""
if len(numbers)%2==0:
pass
else:
return numbers[len(numbers)//2-1]