Command Palette

Search for a command to run...

Hectal
Phase 2: Control Flow
Python · Exercise 1 of 6Next
Beginner

Turn a score into a grade

The variable score holds a number. Set the variable grade using if, elif and else: "A" for 90 or more, "B" for 75 or more, "C" for 60 or more, and "F" for anything lower.

Then print the line Grade: followed by the grade, for example Grade: B. Your program must work for any score, not only the one in the starter.

What Check tests

  1. A score of 83 gives B
  2. A score of 95 gives A
  3. The boundary 60 gives C and 59 gives F
  4. The boundary 75 gives B and 90 gives A
  5. The program prints Grade: B

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

main.py
Sign in to run your code.

Output

Press Run to see what your program prints.