Exam Grade Bucketer

Easy ⏱ 8 min 75% acceptance ★★★★★ 4.5
Write a function grade_for(score) that converts a numeric score (0-100) into a letter grade: "A" for 90 and above, "B" for 80-89, "C" for 70-79, "D" for 60-69, and "F" below 60.

Examples

Example 1
Input
grade_for(93)
Output
"A"
Explanation

93 >= 90.

Example 2
Input
grade_for(55)
Output
"F"
Explanation

55 is below 60.

Constraints

  • 0 <= score <= 100.

Topics

Conditional Statementsif/elif/else

Companies

AccentureDeloitte

Hints

Hint 1

Order your elif checks from highest threshold to lowest.

Hint 2

Once a branch matches, later elifs are skipped automatically.

Loading the Python runtime… Run executes your code and shows printed output; Submit checks your function against this problem's examples.