我決定做一個簡單的程序,但每當我嘗試運行它,它給我一個語法錯誤,並突出顯示「試試= 1」紅色。我不明白爲什麼它這樣做?Python錯誤「試試= 1」
下面是代碼:
print("A chance to in a jack\"ass\"pot! Enter a number between 1 and 10!"
tries = 1
while 1:
if tries == 3:
print("You lose!")
break
val = input("Enter the number: ")
if val == 7:
print("Well done! You win $10 million of fake currency")
break
else:
print("Try again loser")
tries += 1
input("Press enter to continue...")
有你的打印語句沒有結束')'。 –
哦,太笨了!謝謝。 – AvZ