Experiment 1 Code
Experiment 1 Code
Experiment 1 Code
def calculateStatistics(data):
meanValue = mean(data)
medianValue = median(data)
modeValue = mode(data)
return meanValue,medianValue,modeValue
data1 = [1, 2, 3, 4, 5, 4, 3, 2, 4, 5, 1, 2, 3, 4, 2, 5, 1, 3, 2, 1, 2, 1, 1, 1, 2]
data2 = [1, 2, 3, 4, 5, 4, 3, 2, 4, 5, 1, 2, 3, 4, 2, 5, 1, 3, 2, 1, 2, 1, 1, 1, 2000]
data3 = [1, 2, 3, 10, 20, 30, 100, 200, 300, 1000, 2000, 3000]
data1Mean,data1Median,data1Mode = calculateStatistics(data1)
data2Mean,data2Median,data2Mode = calculateStatistics(data2)
data3Mean,data3Median,data3Mode = calculateStatistics(data3)