I have to create individual scores from the keyboard and store them in a list. Then call each of the three functions,passing the list,to compute the average, highest, and lowest score. ##note create 3 functions (ave,high,low),and pass the list to each
What am I doing wrong??
I'm a mess right now with this sorry for all the extra stuff!
def getScores():
"""This function asks the user for list of scores
"""
validNums=("0123456789")
lstScores=[ ]
strNum="0"
while len(strNum) > 0:
strNum=raw_input("Enter a number or press ENTER when done: ")
if len(strNum) > 0:
for digit in strNum:
if digit in validNums:
lstScores.append(int(strNum))
else:
print "invalid data entered!"
return lstScores
def DataSort(sortedScores=[ ]):
sortedScores.sort()
return sortedScores
def Average(avgScores=[]):
sum(lstScores) / len(lstScores)
for avg in avgScores:
print avgScores
return avgScores
##def DataPrint(scoresToPrint=[ ]):
## for score in scoresToPrint:
## print score ####list sort
###MAINLINE
lstScores=getScores()
##sortedScores=DataSort(sortedScores=lstScores)
avgScores=Average()
##DataPrint(scoresToPrint=sortedScores)
print
print lstScores
print
print avgScores
##print sortedScores
##for num in lstScores:
## print num
##for avg in avgScores:
##print avg