Advertisements
Advertisements
Question
Write a program to find the grade of a student when grades are allocated as given in the table below.
| Percentage of Marks | Grade |
| Above 90% | A |
| 80% to 90% | B |
| 70% to 80% | C |
| 60% to 70% | D |
| Below 60% | E |
The percentage of the marks obtained by the student is input into the program.
Short/Brief Note
Advertisements
Solution
Program:
#Program to print the grade of the student
n = float(input('Enter the percentage of the student: '))
if(n > 90):
print("Grade A")
elif(n > 80):
print("Grade B")
elif(n > 70):
print("Grade C")
elif(n >= 60):
print("Grade D")
else:
print("Grade E")
OUTPUT:
Enter the percentage of the number: 60
Grade Dshaalaa.com
Is there an error in this question or solution?
