那么我在这里做错了什么?
answer = int(input("What is the name of Dr. Bunsen Honeydew's assistant?"))
if answer == ("Beaker"):
print("Correct!")
else:
print("Incorrect! It is Beaker.")
然而,我只得到了
Traceback (most recent call last):
File "C:\Users\your pc\Desktop\JQuery\yay.py", line 2, in <module>
answer = int(input("What is the name of Dr. Bunsen Honeydew's assistant?"))
File "<string>", line 1, in <module>
NameError: name 'Beaker' is not defined
int
,但期望得到一个string
?尝试使用int("5")
和int("hello")
。 - Abdelouahab Pp