Grade Calculator
Python
15 pts
Grade Calculator
Write a function grade(score) that returns a letter grade as a string:
| Score | Grade |
|---|---|
| 90 to 100 | “A” |
| 80 to 89 | “B” |
| 70 to 79 | “C” |
| 60 to 69 | “D” |
| 0 to 59 | “F” |
If the score is below 0 or above 100, return "Invalid". The function must return the grade, not print it.
Checklist
- Define
grade(score). - Return the right letter for each range.
- Return
"Invalid"for impossible scores.
🔑 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.
