Created mean and median functions

This commit is contained in:
Souvikdeb2612
2020-10-19 11:45:49 +05:30
committed by GitHub
parent 94e35c24e6
commit d33de18627

View File

@@ -0,0 +1,13 @@
.__init__ import *
def meanMedianFunc(maxlen = 10):
randomlist = random.sample(range(1, 99), maxlen)
total = 0
for n in randomlist:
total = total + n
mean = total/10
problem = f"Given the series of numbers {randomlist}. find the arithmatic mean and mdian of the series"
randomlist.sort()
median = (randomlist[4]+randomlist[5])/2
solution = f"Arithmetic mean of the series is {mean} and Arithmetic median of this series is {median}"
return problem, solution