DML School of Technology
Menu

First steps, Decisions

Scores into grades

The task

Turn a score from 0 to 100 into a grade:

ScoreGrade
70 and aboveA
60 to 69B
50 to 59C
45 to 49D
40 to 44E
below 40F

Test the boundaries: 70, 69, 45, 44, 40, 39.

Write a function called grade.

Tests

CallExpectedYours
grade(85) 'A' not run
grade(70) 'A' not run
grade(69) 'B' not run
grade(60) 'B' not run
grade(55) 'C' not run
grade(50) 'C' not run
grade(47) 'D' not run
grade(45) 'D' not run
grade(44) 'E' not run
grade(40) 'E' not run
grade(39) 'F' not run
grade(0) 'F' not run

Next challenge · All challenges

solution.py

Tab indents. To leave the editor, press Escape, then Tab.

Output

Run prints what your code prints. Run the tests to check your function.