【发布时间】:2022-11-15 22:48:56
【问题描述】:
金银岛项目:
print("Welcome to the Treasure Island.\nYour mission is to find the treasure. Good luck.")
left_or_right = input('''You are at a crossroad where do you wanna go? Type "left" or "right"\n''')
if left_or_right == "right" or "Right":
print("You fall in a hole and die. Game over.")
else:
swim_wait = input('''You come at a lake. There is an island in the middle of the lake.\nType "wait" to wait for a
boat & "swim" to swim to the island''')
else 语句应该要求用户输入,但它打印的是"You fall in a hole and die. Game over."。我检查了缩进:我觉得一切都很好。问题是什么?
【问题讨论】:
标签: python python-3.x if-statement