Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hi ed, the program asks the user for how many numbers they want, then the values of each of those numbers, then works out the sum of the number, sum of the numbers sqaured, mean, mean squared,standard diviation and the error in the mean. the program now needs to produce a list or table of the values of x entered by the user, this i cant do. the writing after a # is just read only and is not code. thanks for having a look no worries i you cant help. peace x
- #Stats Coursework
- import math
- s=0.0
- s2=0.0
- count=0.0
- n=int(raw_input("Please enter how many numbers you like: "))
- for count in range (0,n):
- x=float(raw_input("Please enter a value for a number: "))
- s=s+x #sum of the numbers
- s2=s2+x**2.0 #sum of the numbers squared
- mean=s/n #mean
- mean2=s2/n #mean sqaured
- stndev=math.sqrt(mean2-mean**2.0) #standard diviation
- var=stndev/math.sqrt(n) #error in the mean
- print "the sum of the numbers are:",s
- print "the sum of the square of the numbers are:",s2
- print "the sum of the mean of the numbers are:",mean
- print "the sum of the Square of the numbers mean is:",mean2
- print "the Standard deviation of the numbers are:",stndev
- print "the error in the mean is:",var
Add Comment
Please, Sign In to add comment