我希望程序对特定的字符串输入做出反应。在我的情况下,它是"no"
或"n"
,但它不是;这里的错误在哪里?
import random
print ("hi this is a surprise generation app")
y1=""
y=""
y=input("wanna try?")
if y!="no" or "n": # doesn't react to NO input here
y1=y
while y1!="no" or "n": # doesn't react to NO input here
x=random.randint (1,2)
if x==1:
print("you've got a free account @ counter-strike")
y1=input("one more time?")
elif x==2:
print ("your suprise is a cake")
y1=input("one more time?")
else:
input ("\n")`