0

i have an introduction to programming class and i'm trying to write this program and the program is supposed to loop if you don't input a number within a specific range but it doesnt do it

```
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: ')
totalScores = totalScores + score
return totalScores
#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()
```