小编Mat*_*y G的帖子

而循环python故障

我最近在高中做了一个gamedev课程,我们一直在使用Mac的终端运行python编码来制作基于文本的游戏.我认为这是python 2.7的一个版本,我遇到了一个错误

while Menuselect != "play":
    MenuSelect = raw_input("Type 'quit' to exit - 'credits' for credits - Type 'play' to start\n")
    MenuSelect = MenuSelect.lower()
    if MenuSelect == "quit":
        SystemExit(0)
    elif MenuSelect == "credits":
        print("Lmao, only Matt made this")
    else:
        print("You mistyped. 10/10")

print(": You wake up in a dark room, you don't know where you are or how you got here :")
Run Code Online (Sandbox Code Playgroud)

当我尝试运行它并输入'play'来停止循环时,它会再次继续循环.有什么问题吗?

python terminal python-2.7

1
推荐指数
1
解决办法
91
查看次数

标签 统计

python ×1

python-2.7 ×1

terminal ×1