Nov-18-2018, 02:25 AM
(Nov-17-2018, 06:36 PM)ichabod801 Wrote:(Nov-17-2018, 06:10 PM)searching1 Wrote: Any idea how can I retain the same question if it's wrong?
To continue asking if the answer is wrong, use a while loop, and exit if the answer is correct. Something like:
while True: student = input(qs[i]+ "\n Ilagay ang iyong sagot: ").upper() if student == an[i].upper(): print("Correct\n") score += 1 break else: print("\n Wrong! Try Again\n") print("Attempt",count) count += 1
Result is the same, It;s keeps repeating the question once break has been initiated.