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 242 views
4 answers 490 views
1 answer 182 views
182 views asked Mar 10, 2023 by avibootz
1 answer 216 views
1 answer 223 views
1 answer 222 views
...