-3
while Winner == "":
while First_Player_Turn == "Y":
while rtd != "":
try:
rtd = input("{} press enter to roll the dice".format(First_Player))
if rtd == "":
dice = random.randint(1, 6)
First_Player_Position = dice + First_Player_Position
steps_left = 50 - First_Player_Position
print("{} needs {} steps to finish".format(First_Player, steps_left))
if First_Player_Position >= 50:
Winner = "Y"
First_Player_Turn = "N"
Second_Player_Turn = "Y"
print("Test to see if this is printed - It is but not in wingide")
continue
except:
print("Please press enter")
while Second_Player_Turn == "Y":
我已經測試過這個多次,我發現wingide並不顯示Tested部分,但是Python正常。我想要發生的是當它通過First_Player_Turn
循環運行到Second_Player_Turn
循環。Python在打印語句中停止
我們不是在這裏爲你解決你的工作,我們會提供幫助。你有什麼嘗試? –
如果您從命令行和IDE獲得不同的結果,最常見的問題是您運行的是兩個不同版本的python,可能是2和3. input()特別可以向您發送奇怪的路由。 – cdarke
在當前狀態下很難回答你的問題。如果您發佈其他人可以用來嘗試重現問題的[mcve],這將有所幫助。順便說一句,不建議使用這樣的未命名'except',並且不清楚爲什麼你在代碼中使用它。你期望它做什麼? –