Created
April 8, 2015 01:35
-
-
Save gilrg18/2bc6fb6ad41461a63a57 to your computer and use it in GitHub Desktop.
WSQ10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Gilberto Rogel García A01630171 | |
import statistics | |
def totalsum(list): | |
sum=0 | |
for x in range (0,len(list)): | |
sum+=list[x] | |
return (sum) | |
def average(list): | |
avrg=totalsum(list)/10 | |
return (avrg) | |
def standarddev(list): | |
std= statistics.stdev(list) | |
return (std) | |
list=[] #Empty list | |
x=0 | |
while(x<10): | |
num=float(input("Give me a number to add to the list:")) | |
list.append(num) #Adds floats to the list | |
x=x+1 | |
print ("Your list is",list) | |
print("The total sum of your numbers is:",totalsum(list)) | |
print("The average of your numbers is:",average(list)) | |
print("The standard deviation of your numbers is:",standarddev(list)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment