Write a program that generates six random numbers in a sequence created with
(start, stop, step). Then print the mean, median and mode of the generated numbers.
Answers
Answered by
7
Answer:
#program 1
# generate six random numbers and find mean mode and median
a=int(input("enter start value"))
b=int(input("enter the stop value"))
s=int(input("enter the step value"))
import random
a=random.randrange(a,b,s)
b=random.randrange(a,b,s)
c=random.randrange(a,b,s)
d=random.randrange(a,b,s)
e=random.randrange(a,b,s)
f=random.randrange(a,b,s)
import statistics
seq=[a,b,c,d,e,f]
mean=statistics.mean(seq)
print(mean)
median=statistics.median(seq)
print(median)
mode=statistics.mode(seq)
print(mode)
Similar questions