diff --git a/mathgenerator/funcs/meanMedianFunc.py b/mathgenerator/funcs/meanMedianFunc.py new file mode 100644 index 0000000..5f06a1c --- /dev/null +++ b/mathgenerator/funcs/meanMedianFunc.py @@ -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