python_math_stat/practica/math/statistic/Statistic_tasks/median.py

6 lines
156 B
Python
Raw Normal View History

# медиана
def find_median(x):
if len(x) % 2 == 0:
return (x[len(x) // 2] + x[len(x) // 2 -1]) / 2
else:
return x[len(x) // 2]