Oct-24-2019, 11:53 PM
I am attempting to write a short practice script that finds the average of a user defined number of scores.
Here is the code I have:
My goal is for this to calculate the average but it doesn't seem to be doing that. What it's doing is calculating something else. No matter how I change it up it keeps giving me odd answers.
Can anyone tell me what I'm doing wrong?
Here is the code I have:
1 2 3 4 5 6 7 8 9 10 11 12 |
total = int ( input ( 'How many scores are there? ' )) total_sum = 0 for i in range (total): Scores = float ( input ( 'Enter a score : ' )) total_sum + = Scores avg = Scores / total_sum print ( 'The average of the scores is: ' , avg) |
Can anyone tell me what I'm doing wrong?