初学者在这里学习python。我在处理以下代码时遇到问题。我正在尝试比较数字,但我得到一个“无法解决的类型错误”。我不明白为什么,因为两个被比较的数字都是整数。
winning_number = 5
guess = input("Can you guess the lucky number.\nHint it's between 1 and 10!\n")
def compare(guess):
if guess > winning_number:
print ("Wrong, you're guess is too high")
elif guess < winning_number:
print ("Wrong, you're guess is too low")
else:
pass
compare(guess)