我添加了这个函数,它可以确保用户确实想要退出程序。当你真的想退出时,它会起作用,但如果你想返回程序,它只会循环语句: Quit = raw_input("Please enter y if you are sureyou want to quit, if not press n to return ") print ('')
elif Quit ==
然而,我不能让循环退出,所以它说,虽然滚不等于‘退出’,但做事情。我将发布下面的代码,但我不知道如何让它工作,以便当我输入“退出”时,它会关闭,现在当我这样做时,它会输出“else”语句。 if ROLL == 6: elif ROLL == 8:print(random.randint(1, 8))
elif ROLL == 10: