Q. 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.

 

 Answer = 



import random
import statistics

start = int(input("Enter Start :-"))
stop = int(input("Enter stop :- "))
step = int(input("Enter step :- "))

a = random.randrange(start,stop,step)
b = random.randrange(start,stop,step)
c = random.randrange(start,stop,step)
d = random.randrange(start,stop,step)
e = random.randrange(start,stop,step)
f = random.randrange(start,stop,step)

print( "Numbers are =",a,b,c,d,e,f )
print("Mean = ", statistics.mean( ( a,b,c,d,e,f ) ) )
print("Mode = ", statistics.mode( ( a,b,c,d,e,f ) ) )
print("Median =", statistics.median( ( a,b,c,d,e,f ) ) )



 

 

 


4 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. why there is no answers

    ReplyDelete
    Replies
    1. It is due to mistake. I will upload answer .

      Delete
  2. When will you upload??

    ReplyDelete
    Replies
    1. Sorry , Please check again I have uploaded it . : )

      Delete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post