当我打开我的.py文件与此代码中,它显示了一个简短的第二次,然后消失。我如何解决这个问题,以便我可以看到输出结果?运行我的Python代码我的Python只是关闭
print "Hello welcome to Mcdonald's how may I help you"
print "Type 1 for food"
print "Type 2 for drinks"
user_input = input ("Type 3 for money")
if (user_input) == 1:
print "We have Hamburgers, fries, and cancer"
print "Type 1 for hamburgers"
print "Type 2 for fries"
user_input = input ("Type 3 cancer")
if (user_input) == 1:
print "That will cost you $1.25"
print "Type 1 to pay"
user_input = input ("Type 2 to steal")
if (user_input) == 1:
user_input = input ("Thank you for comming")
elif (user_input) == 2:
user_input = input ("HEY COME BACK AND PAY!")
elif (user_input) == 2:
user_input = input ("Potato!")
elif (user_input) == 3:
user_input = input ("Sorry we are out of cancer")
if (user_input) == 2:
print "We have Coke, and Pepsi"
print "Type 1 for Coke"
user_input = input ("Type 2 for Pepsi")
if (user_input) == 1:
user_input = input ("COKE SUCKS NO DRINKS FOR YOU!!!!!")
elif (user_input) == 2:
print "Nice I LOVE Pepsi Coke sucks that will cost you $1.00"
print "Type 1 to pay"
user_input = input ("Type 2 to steal")
if (user_input) == 2:
user_input = input ("HEY COME BACK AND PAY!")
if (user_input) == 3:
print "So heres the plan you take the register ill destract the others."
print "Type 1 To call the cops"
user_input = input ("Type 2 to do the plan")
if (user_input) == 1:
user_input = input ("You got $150 for calling the cops")
elif (user_input) == 2:
user_input = input ("You got $150 for doing the plan")
else:
print "Sorry I did not get your order"
*“巨蟒只是关闭” * - 您是否使用的窗口?并在Windows资源管理器中双击该文件?如果是的话,那么你将不得不学习如何使用命令行或添加什么东西在你的程序结束时暂停执行(例如:一个'输入()') – UnholySheep
也请(学会)正确地格式化你的代码,有创建 – UnholySheep
此外,如果你想在这里粘贴代码的问题时做的大部分是自动选择,请用“输入代码”按钮做到这一点。现在它是不可读的。 – Moberg