list median python code example
Example 1: median of a list python
import statistics
lst = [1,3,6,13,27]
median_value = statistics.median(lst)
print(median_value)
Example 2: 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)))