How to find the higher 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 high of the two middle items
print(statistics.median_high(lst1))
 
lst2 = [1, 5, 7, 8, 9, 12]     
print(statistics.median_high(lst2))
 
 
 
 
'''
run:
 
8
8
  
'''

 



answered Jul 28, 2019 by avibootz
...