Answers for "how to find the median of a list in python"

1

median of a list python

import statistics

lst = [1,3,6,13,27]
median_value = statistics.median(lst)
print(median_value)
Posted by: Guest on March-25-2021
0

find the median of input number in a list and print

import statistics
array = []
n = int(input())
for _ in range(n):
    array.append(int(input()))
print (int(statistics.median(array)))
Posted by: Guest on December-16-2020

Code answers related to "how to find the median of a list in python"

Python Answers by Framework

Browse Popular Code Answers by Language