This is what I attempted to write so far

It says that number students is not defined on the line where getGrades() is called

It looks right to me =\ teacher just says to figure it out myself when I am stumped

- Code: Select all
`#This program is used to find the students average`

#This code is written by Charles Barnett on October 7

#This is the main function

def main():

retry = 'y'

while retry == 'y' or retry == 'Y':

getStudents()#This calls number of students

getGrades(numberStudents)#This calls the total grades

getAverage(testGrades, numberStudents)#This determines the average

printInfo(studentsAverage)#This prints out the results

retry = input('Would you like to try another class? (N for No Y for Yes)')

#This function gets the number of students in a classroom

def getStudents():

numberStudents = input('Please enter number of students in classroom ')

numberStudents = int(numberStudents)

return numberStudents

#This function gets the total test score

def getGrades(numberStudents):

for number in range(numberStudents):

grade = input('Please enter students score')

grade = float(grade)

testGrades = testGrades + grade

return testGrades

#This function gets the average score of all the students

def getAverage(testGrades, numberStudents):

studentsAverage = testGrades / numberStudents

return studentsAverage

#This function prints out the students average scores

def printInfo(studentsAverage):

print 'Your total average is ', studentsAverage

main()

--------------------------------------------------------------------------------------------------------------

Edit: woops sorry I didn't know how I posted twice, well anyways please post here