Python Beginners – use if conditional statement to judge grade

Time:2020-10-31
x = int(input("x="))
If x < 0 or x > 100: # if it is not in the range of 0 -- 100, output error
    print("error")
Elif 100 > x > = 90: # if output a between 100 and 90
    print("A")
Elif 90 > x > = 80: # if B is output within 90-80
    print("B")
Elif 80 > x > = 70: # if C is output within 80-70
    print("C")
Elif 70 > x > = 60: # if D is output within 70-60
    print("D")
Else: if e is output within 60-70
    print("E")