Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

median of a list in python

import math
list = [ 1 ,9, 4,5,3]
list.sort()
middle_index= len(list)/2
exact_middle_index = math.floor(middle_index)
median_value = list[exact_middle_index]
print(median_value) 
Source by www.alixaprodev.com #
 
PREVIOUS NEXT
Tagged: #median #list #python
ADD COMMENT
Topic
Name
4+9 =