Home > other >  Help!!!!!!
Help!!!!!!

Time:11-20

(per) known to the student zhang three courses of the mid-term exam achievement, and its average program is as follows:
 scores={Chinese: 90, mathematics' : 95, English: 88} 
For I in scores:
Score=i.v alues0
Total=+ score
Print (" grade point average is: ', total/len (scores))

Pointed out the mistakes in the above program (more than one), state the reason for the error, and correct,

CodePudding user response:

1, dictionary of Chinese characters should be a string, in quotation marks, such as scores={' language ': 90,' mathematics', 95, 'English' : 88}
2, the additive should choose one of the average scores, namely value; Variable total value should be ascribed to use, such as
Total=0
For I in scores. The values () :
Total +=I

3, the third, four lines to indent a
4, the last line of print string quotes should be consistent, such as are double quotes or are single quotes, than the "average" or 'average'
5, and finally by the average of best can format, such as total//keep only integer len (scores)
If there are omissions, please supplement downstairs,

CodePudding user response:

Complete write it again:
Scores={' language ': 90,' mathematics', 95, 'English' : 88}
Total=0
For I in scores. The values () :
Total +=I
Print (" average grade: ", total//len (scores))