How to find the lower of the two middle items of a list in Python

1 Answer

0 votes
import statistics

lst1 = [1, 7, 12, 5, 8, 9]   
 
# median sort the list 
# the lower of the two middle items
print(statistics.median_low(lst1))

lst2 = [1, 5, 7, 8, 9, 12]     
print(statistics.median_low(lst2))




'''
run:

7
7
 
'''

 



answered Jul 27, 2019 by avibootz
...