Problem 123970 · easy · Level 01 Prerequisites & Setup

Letter Grade

conditionals · comparison

Write letter_grade(score) that converts a numeric score into a letter grade:

  • 90 or above: "A"
  • at least 80 but below 90: "B"
  • at least 70 but below 80: "C"
  • at least 60 but below 70: "D"
  • below 60: "F"

Examples

Input:  score = 93
Output: "A"

Input:  score = 59
Output: "F"

Input:  score = 80
Output: "B"

Input:  score = 89.5
Output: "B"
Explanation: 89.5 is at least 80 but below 90.

Constraints

  • 0 <= score <= 100 (may be a float such as 69.5)

Goals

  • Chain if/elif/else branches
  • Order thresholds from highest to lowest
Starting Python…