[Solved] I’ve completed the code however I don’t understand what’s wrong [closed]


You’re trying to compare a str with an int. The following will fix it:

def output(number):
    if number > 5:
        print("Greater than 5")
    elif number < 5:
        print("Less than 5")
    else:
        print("It is equal to 5")
userInput = "yes"
print(userInput.lower() != "no")
num = int(input("Enter a number \n"))
output(userInput)
userInput = input("Would you like to try again?")

7

solved I’ve completed the code however I don’t understand what’s wrong [closed]