【发布时间】:2020-02-07 12:23:41
【问题描述】:
下面是我的代码:
name = input ('Whats ur name ? ')
dtion = input (name + ' you are in the forest where do u wanna go? ')
while dtion != "right" or dtion != "Right":
dtion = input ("you are still in the Forest where do u wanna go? ")
print ("You are out of the Forest")
【问题讨论】:
-
请修正你的缩进。
-
dtion != "right" or dtion != "Right"始终为True,因为dtion不能同时是两个不同的字符串。
标签: python-3.x boolean-operations or-operator