Student Grades
Python
15 pts
Student Grades
Add a method grade(self) to the Student class. It must return a letter based on self.mark:
| Mark | Grade |
|---|---|
| 90 or more | "A" |
| 75 to 89 | "B" |
| 50 to 74 | "C" |
| below 50 | "F" |
The code at the bottom prints each student’s grade. Expected output:
Selam: A Merhawi: B Abel: C
Checklist
- Add a method called
gradeto theStudentclass. - Make it return
"A"for a mark of 90 or more and"B"for 75 to 89. - Make it return
"C"for 50 to 74 and"F"below 50. - Run the code at the bottom to print every grade.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
