Skip to content

Instantly share code, notes, and snippets.

@gilrg18
Created April 8, 2015 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilrg18/2bc6fb6ad41461a63a57 to your computer and use it in GitHub Desktop.
Save gilrg18/2bc6fb6ad41461a63a57 to your computer and use it in GitHub Desktop.
WSQ10
#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