私は、Python 2.7でスクリプトを書いて、これはコードです:なぜこのPythonコードが間違っていますか?
name=raw_input("Hi im a PC, who are you?")
print("Hi " + name + " how are you, are you good?")
answer = raw_input("")
if (answer) == yes:
print("That's good to hear")
elif (answer) == no:
print("Oh well")
else:
print("Sorry, you didnt answer the question properly, Please answer with a yes or no")
これは私が取得エラーです:
Traceback (most recent call last): File "C:/Python27/programs/2", line 4, in if (answer) == yes: NameError: name 'yes' is not defined
ありがとうございます! – user1135707