i get this error when i get to a certain part in the program
Traceback (most recent call last):
File "C:/Users/Family/Desktop/13.py", line 54, in <module>
main()
File "C:/Users/Family/Desktop/13.py", line 10, in main
averageScores = getAverage(totalScores, averageScores, number)
File "C:/Users/Family/Desktop/13.py", line 46, in getAverage
averageScores = totalScores / number
TypeError: unsupported operand type(s) for /: 'tuple' and 'int'
heres the code
def main():
endProgram = 'no'
print
while endProgram == 'no':
totalScores = 0
averageScores = 0
number = 0
number = getNumber(number)
totalScores = getScores(totalScores, number)
averageScores = getAverage(totalScores, averageScores, number)
printAverage(averageScores)
endProgram = raw_input('Do you want to end program? (Enter yes or no): ')
while not(endProgram == 'yes' or endProgram == 'no'):
print'Please enter a yes or no'
endProgram = raw_input('Do you want to end program? (Enter no to process a new set of scores): ')
#this function will determine how many students took the test
def getNumber(number):
number = input('Enter a number between 2 and 30: ')
while number <=2 or number >=30:
print'You must enter a number between 2 and 30'
number = input('Enter a number between 2 and 30:')
return number
#this function will get the total scores
def getScores(totalScores, number):
for counter in range(0, number):
score = input('Enter their score: ')
while score<=10 or score>=100:
print'You must enter a number between 0 and 100'
score = input('Enter a number between 0 and 100:')
totalScores = totalScores + score
return totalScores, number
#this function will calculate the average
def getAverage(totalScores, averageScores, number):
averageScores = totalScores / number
return averageScores
#this function will display the average
def printAverage(averageScores):
print 'The average test score is', averageScores
# calls main
main()