Problem 123970 · easy · Phase 01 Prerequisites & Setup

Letter Grade

conditionals · comparison

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

  • 90 or above: "A"
  • 80 to 89: "B"
  • 70 to 79: "C"
  • 60 to 69: "D"
  • below 60: "F"

Examples

Input:  score = 93
Output: "A"

Input:  score = 59
Output: "F"

Input:  score = 80
Output: "B"

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…