Looping back to a question

Hi Everyone, I am on day 12 of 100 days of Replit and I have fixed the errors, however, I want to go one further and when they answer the first question wrong, I want the user to be able to answer again using the original question after “Line 8”. How would I go about doing this?

  1. print(“100 Days of Code Quiz”)
  2. print()
  3. print("How many can you answer correctly? ")
  4. ans1 = input(("What language are we writing in? "))
  5. if ans1 == “Python”:
  6. print(“Correct”)
  7. else:
  8. print(“Nope, try again!”)
  9. ans2 = int(input("Which lesson number is this? "))
  10. if int((ans2>12)):
  11. print(“We’re not quite that far yet”)
  12. elif int((ans2<12)):
  13. print(“We’ve gone well past that!”)
  14. if int((ans2==12)):
  15. print(“That’s right!”)

3 posts were merged into an existing topic: Day 012 - Project 12 : I’ve broken some code!

Moved here to the DoC 12 topic