How to find median of a list in Python

1 Answer

0 votes
import statistics

lst = [1,2,3,4,5,6,7,8,9,10,11,12]

print(statistics.median(lst))
print(int(statistics.median(lst)))





'''
run:

6.5
6

'''

 



answered Mar 10, 2023 by avibootz

Related questions

1 answer 147 views
4 answers 263 views
1 answer 96 views
1 answer 114 views
1 answer 114 views
1 answer 113 views
...