Grade Calculator
Easypython
Take a mark out of 100 and print the letter grade it earns.
Grading scale: A (marks >= 90), B (marks >= 75), C (marks >= 60), D (marks >= 40), Fail (below 40).
Approach: this is a direct if-elif-else chain — check the highest boundary first, and let the first matching condition decide the grade.
Input: One line: marks, a whole number from 0 to 100.
Output: One line: Grade: <letter>
Example 1
Input
82
Output
Grade: B
- 0 <= marks <= 100
Hint 1
Check thresholds from highest to lowest: 90, then 75, then 60, then 40.
Hint 2
Only the first matching condition in the chain should run.
Check the boundaries from highest to lowest with if / elif so that once a condition matches, Python stops checking the rest: marks >= 90 -> A, elif >= 75 -> B, elif >= 60 -> C, elif >= 40 -> D, else -> Fail.