Write a program to print the grade of a student, based upon the average marks he/she has scored.
Condition Grade
>90 and <=100 A+
>80 and <=90 A
>70 and <=80 B+
>60 and <=70 B
>50 and <=60 C+
>40 and <=50 C
<=40 D
Answers
Answered by
3
def grader(marks):
if 90 < marks <= 100:
return "A+"
if 80 < marks <= 90:
return "A"
if 70 < marks <= 80:
return "B+"
if 60 < marks <= 70:
return "B"
if 50 < marks <= 60:
return "C+"
if 40 < marks <= 50:
return "C"
return "D"
print("Grade:", grader((_ := float(input("marks: ")))))
Similar questions
Social Sciences,
2 months ago
Computer Science,
2 months ago
India Languages,
5 months ago
Computer Science,
5 months ago
Science,
11 months ago
Social Sciences,
11 months ago
Chemistry,
11 months ago