0

I'm a new python user. I don't know how to go to a certain line in the .py file I'm trying to make like a 'restart button' so I don't need to re-run to open it again.

as example:

    print ("quizzes")
    a1 = input("do you want to try again?")

    if a1 = "YES" :
    {the code to get back to Line 1}

i am trying to get back to line 1 so they could answer the quiz again if possible

the soup
  • 25
  • 3

1 Answers1

1

try:

while(True):    
    print ("quizzes")
    a1 = input("do you want to try again?")

    if a1 == "NO" :
         break
Nilanka Manoj
  • 3,527
  • 4
  • 17
  • 48