Loading...
Loading...
Loading...
Write grade(marks) that returns a grade letter: A for 90 or more, B for 75 to 89, C for 50 to 74, D for 40 to 49 and F below 40. Read the marks and print the grade.
Example 1
Input
82
Output
B
Between 75 and 89.
Example 2
Input
39
Output
F
Below 40.
Try the problem first. Open one hint at a time.
Check the highest grade first, so each later test only has to look at one limit.
Use if, elif and a final return for F.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor