0
所以我有明天到期的評估(這是全部完成),並希望增加一些更多的細節。 我將如何: a。這樣做,如果你回答錯誤的問題,你可以重試兩次 b。如果你完全失敗,你會看到答案 我該怎麼做?謝謝 ps。該代碼lloks弱智,我不能讓它在想要打印答案,如果q回答不正確,並給兩個機會
} output = " " score = 0 print('Hello, and welcome to my quiz on Ed Sheeran!') for question_number,question in enumerate(questions): print ("Question",question_number+1)
print (question)
for options in questions[question][:-1]:
print (options)
user_choice = input("Make your choice : ")
if user_choice == questions[question][-1]:
print ("Correct!")
score += 1
print (score)
print (output)
else:
print ("Wrong!")
print (score)
print (output)
print(score)
嗨,這個最有效,但IM仍然得到一個錯誤「沒有價值的(輸出)」,這點我是希望能顯示答案。我在這裏放置什麼:output =?。雖然 –
你的'答案'是在'問題'中,還是在其他一些變量? –