Hello, my assignment is to make a program that allows a teacher to enter any number of tests grades and it will give them the average. My problem is my average isn't correctly working? For example I plug in numbers 85, 75, 96 I SHOULD get 85.3. However I'm getting in my return, 86.2. Anyone able to tell me where my math is wrong or what would be causing this to spit out a number 1.1 off?
My code:
My code:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
count = 0 total = 0 toContinue = "y" while toContinue ! = "n" : grade = int ( input ( "Enter a test grade: " )) for eachPass in range (grade): count = count + 1 total = total + grade toContinue = input ( "Are there any more test grades to enter, 'y' or 'n'? " ) if toContinue = = "n" : print ( "The average is" , round (total / count, 1 )) print ( "I'm done" ) break |