jeudi 28 janvier 2021

Why is Python greater than operand not working? [duplicate]

I am creating code for a simple teachers grading system in which you input the numeric grade and it tells you if it is an A, B, C, etc. I first wanted to put a limit on the numbers you can input, i.e. can't put less than zero or more than one hundred, but it is not working. Can anyone explain why?

import time
from time import sleep
grade = 0
maximum = 100
minimum = 0
grade = input("""Insert numeric grade:
""")
time.sleep(1)
if grade > maximum:
    print ("Please enter a valid grade.")

Aucun commentaire:

Enregistrer un commentaire