在我完成下面的代码后,我检查了它是否有效。问题是,无论我键入什么,它总是显示“如果”的响应,即使我更改了响应
我试着改变立场和反应,但没有任何效果
hello = input ("Hello there! \n My name is PIM. \n It `enter code here` stands for Primary Interactive Machine. \n What is your name?")
print ("Nice to meet you," + hello)
ans1 = input ("Can I ask you a question? <yes/no>")
if (ans1 == 'yes',' yes')
ans2 = input ("Which color do you prefer? <blue/pink>")
elif(ans1 == 'no',' no'):
print ("Well then, we will just stay in silence")
else:
print ("I will not talk to someone who doesn't care about me. \n You had one simple job, choose yes or no and even then, you failed.")
预期它会相应地回复响应,但它只发送“if”回复
试试这个:
相关问题 更多 >
编程相关推荐