Exercise · Conditions and loops · lesson 10 of 13
Exercise: letter grade
Write a function function grade(score) that turns points into a letter grade:
- 90 points or more:
"A"; - 75–89:
"B"; - 60–74:
"C"; - below 60:
"F".
Examples:
grade(90)→"A"grade(74)→"C"grade(59)→"F"
Constraints: score is an integer from 0 to 100 inclusive.
Do not add extra imports unless the task says so explicitly.
Subscribe to take the course
The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.