Python Forum

Full Version: error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
marks = input()
if 33 < marks < 45:
    print("pass")
else:
    if 45 < marks < 60:
        print("second")
    else:
        if 60 < marks < 75:
            print("first")
        else:
            if marks > 75:
                print("well_played")
            else:
                print("fail")
could someone please tell me the reason for the error, and please solve that error.
Im assuming you mean this error?
Error:
Traceback (most recent call last): File "test11.py", line 2, in <module> if 33 < marks < 45: TypeError: '<' not supported between instances of 'int' and 'str'
input() returns a string and you need to convert it to an int first.

int(input())