I Haz Codes

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Menu
Grade calculator

Using a set of IF statements you need to write a simple python program which will work out your grade on a test.

The grade boundaries are –

  • A – 81+
  • B – 75
  • C – 69
  • D – 63
  • E – 58
  • U – <=57

The program should do the following –

  • Ask for a number.
  • Check each of the grade boundaries.
  • Display the correct grade.

Hint – You will need to use elif instead of if when you add each additional if statement.

score = int(input("Please enter a score - "))
if score >= 81:
    print("A")
elif .......

You need to log in or create an account to submit code!

Leave a Reply

Your email address will not be published. Required fields are marked *

Information