我正在为一个学校项目制作一个测验游戏,我想制作它,以便当用户输入无效命令时,它会返回并尝试输入再次转到该菜单并显示完全相同的输入框并尝试代码再次。我将在我希望发生这种情况的地方发布一个部分。
#---->TO HERE
if userinput == str("help"):
print ("This is the help menu")
print ("This is how you play")
else:
print ("Invalid Command")
#This is where I want the user to go back and try entering a command again to get the same code to run through again.
#FROM HERE <----