python_math_stat/practica/math/statistic/Statistic_tasks/median.py
2023-10-05 18:10:40 +03:00

6 lines
156 B
Python

# медиана
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]