If else Grading scheme | Python Language Forum
H
Heena Goyal Posted on 04/08/2023
Write a program to calculate the grade of a student from his marks from the following scheme:

90-100 = Ex   

80-90 = A   

70-80 = B   

60-70 = C   

50-60 = D   

<50 = F

In the above problem, if we look at the grading scheme, 60, 70, 80, 90 are in two grade schemes. is this question correct this way? If yes, then, for eg. 90 will be A or Ex.

OR,

the grading scheme should be:

91-100 = Ex   

81-90 = A   

71-80 = B   

61-70 = C   

50-60 = D   

<50 = F


Please suggest.

Y
Yogesh Chawla Replied on 04/08/2023

Yes, you can follow your second logic to write the code