-1
我試圖循環這個塊4次,所以它顯示在第一,第二,第三和第四的參賽者結束。有人可以幫忙嗎?列表 - contestants
在Python中循環4次
total = 0
contestants = ["Vera Lynn" , "Billy Halliday", "Frank Sinatra"]
contestant_name = input(" What's Your Name: \n ") # Asking For The Contestants Name
print("Judges make your votes\n")
for vote in range(0, 4): # Making A Loop
judge = input("Yes Or No: ")
if judge == 'Yes':
total = total + 1
print(total)
if total >= 2:
print("Well Done ", contestant_name, " you have", total, "votes." +
" you are moving on to the next round")
else:
print("Unlucky", contestant_name, " you have", total, "votes." +
" Unfortuanely you are not moving to the next round")
期望的輸出和電流輸出是什麼? – Zenadix
如果你想整個事情做4次,看看誰來到了哪個地方,你必須重新調整一下。字典將有助於跟蹤每個人的分數;一些檢查,以確保參賽者不會兩次;等等 – maccartm