Question 4 Students in a class receive their grades as Pass/Fail. Scores of 60 or more (out of 100) mean that the grade is "Pass". For lower scores, the grade is "Fail". In addition, scores above 95 (not included) are graded as "Top Score". Fill in this function so that it returns the proper grade. def exam_grade(score): if 95: grade = "Top Score" elif 60: grade = "Pass" else: grade = "Fail" return grade print(exam_grade(65)) # Should be Pass print(exam_grade(55)) # Should be Fail print(exam_grade(60)) # Should be Pass print(exam_grade(95)) # Should be Pass print(exam_grade(100)) # Should be Top Score print(exam_grade(0)) # Should be Fail
Answers
Answered by
2
Explanation:
Students in a class receive their grades as Pass/Fail. Scores of 60 or more (out of 100) mean that the grade is "Pass". For lower scores, the grade is "Fail". In addition, scores above 95 (not included) are graded as "Top Score".
def exam_grade(score):
if 100 > 95:
grade = "Top Score"
elif 95 >55:
grade = "Pass"
else:
grade = "Fail"
return grade
print(exam_grade(65)) # Should be Pass
print(exam_grade(55)) # Should be Fail
print(exam_grade(60)) # Should be Pass
print(exam_grade(95)) # Should be Pass
print(exam_grade(100)) # Should be Top Score
print(exam_grade(0)) # Should be Fail
Answered by
1
4. Students in a class receive their grades as Pass/Fail. Scores of 60 or more (out of 100) mean that the grade is "Pass". For lower scores, the grade is "Fail". In addition, scores above 95 (not included) are graded as "Top Score". Fill in this function so that it returns the proper grade. 1 2- amino def exam_grade (score): if : grade = "Top Score" elif grade - "Pass" else: grade = "Fail" return grade 10 Run 11 12 13 14 15 print(exam_grade (65)) # should be Pass print(exam_grade (55)) # should be Fail print(exam_grade (60)) # Should be pass print(exam_grade (95)) # Should be pass print(exam_grade (100)) # Should be Top Score print(exam grade (@)) # Should be Fail Reset.
Similar questions
Math,
3 months ago
Math,
3 months ago
Social Sciences,
7 months ago
Math,
11 months ago
History,
11 months ago