Python Gets the max and the mean of the inputed numbers
Python
Download (.zip)
# Gets the max and the mean of the inputed numbers # From Student debuged, note that we also compute the min
total = input("How many # to use: ") total2= total x = input("Enter a #") max = x min = x total = total -1 mean = x while total>0: x = input("Enter a #") mean = x + mean if x > max : max = x elif x < min : min = x total = total - 1 mean = mean / total2 print "The mean is", mean print "The max is", max print "The min is",min
|