while gradeCounter <= 10: # loop 10 times grade = raw_input( "Enter grade: " ) # get one grade grade = int( grade ) # convert string to an integer total = total + grade gradeCounter = gradeCounter + 1
average = total / 10 # integer division print "Class average is", average
Related Scripts with Example Source Code in same category :