當我打開我的.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