Hi this is a quiz i'm making for school. I've tried to add a restart but nothing worked. i want it to say "do you want to restart". the user then types yes or no and it will begin the quiz again. PLEASE HELP thanks
# rhys translation quiz
#intro and intrustions
score = 0
print ("Welcome to the translation quiz \nYou will be ask a series of questions and have 2 tries per questions\nIf you get the correct answer you will get one point, half a point for getting it your second try and zero points if you get it wrong twice. \nGOOD LUCK!!!\n")
#the word that will have to be translated
question1 = "What is Kia ora in english"
#the opinions that the user and pick from
options1 = "a. Hello\nb. Bye\nc. Greetings\nd. See ya\n"
print(question1)
print(options1)
#user will have to enter a,b,c or d for there answer
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
#simple, if answer is correct print correct and move on to next question, if not try again
if response == "a" or response == "A":
print ("Correct\n")
score = score + 1
break
else:
print("Wrong. Try again.\n")
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "a" or response == "A":
print ("Correct\n")
stop = True
score = score + 0.5
break
else:
print("Wrong. You ran out of attempts\n")
stop = True
break
if stop:
break
#repeat
question2 = "What is tēnā rawa atu koe in english"
options2 = "a. Give it\nb. bye\nc. Thank you\nd. See ya\n"
print(question2)
print(options2)
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "c" or response == "C":
print ("Correct\n")
score = score + 1
break
else:
print("Wrong. Try again.\n")
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "c" or response == "C":
stop = True
score = score + 0.5
break
else:
print("Wrong. You ran out of attempts\n")
stop = True
break
if stop:
break
question3 = "What is rorohiko in english"
options3 = "a. TV\nb. Microwave\nc. Oven\nd. Computer\n"
print(question3)
print(options3)
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "d" or response == "D":
print ("Correct\n")
score = score + 1
break
else:
print("Wrong. Try again.\n")
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "d" or response == "D":
stop = True
score = score + 0.5
break
else:
print("Wrong. You ran out of attempts\n")
stop = True
break
if stop:
break
question4 = "What is motukā in english"
options4 = "a. Van\nb. Car\nc. Truck\nd. bus\n"
print(question4)
print(options4)
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "c" or response == "C":
print ("Correct\n")
score = score + 1
break
else:
print("Wrong. Try again.\n")
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "c"or response == "C":
stop = True
score = score + 0.5
break
else:
print("Wrong. You ran out of attempts\n")
stop = True
break
if stop:
break
question5 = "What is whare kotahi in english"
options5 = "a. Deck\nb. Game\nc. Suit\nd. Card\n"
print(question5)
print(options5)
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "d" or response == "D":
print ("Correct\n")
score = score + 1
break
else:
print("Wrong. Try again.\n")
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "d" or response == "D":
stop = True
score = score + 0.5
break
else:
print("Wrong. You ran out of attempts\n")
stop = True
break
if stop:
break
question6 = "What is haupa in english"
options6 = "a. Food\nb. Drink\nc. Soup\nd. Water\n"
print(question6)
print(options6)
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "a" or response == "A":
print ("Correct\n")
score = score + 1
break
else:
print("Wrong. Try again.\n")
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "a" or response == "A":
stop = True
break
else:
print("Wrong. You ran out of attempts\n")
stop = True
score = score + 0.5
break
if stop:
break
question7 = "What is Ngā Aho Whakaari in english"
options7 = "a. Show\nb. Film\nc. Song\nd. Book\n"
print(question7)
print(options7)
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "b" or response == "B":
print ("Correct\n")
score = score + 1
break
else:
print("Wrong. Try again.\n")
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "b" or response == "B":
stop = True
score = score + 0.5
break
else:
print("Wrong. You ran out of attempts\n")
stop = True
break
if stop:
break
question8 = "What is makawe in english"
options8 = "a. Face\nb. Hair\nc. Neck\nd. Beard\n"
print(question8)
print(options8)
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "b" or response == "B":
print ("Correct\n")
score = score + 1
break
else:
print("Wrong. Try again.\n")
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "b" or response == "B":
stop = True
score = score + 0.5
break
else:
print("Wrong. You ran out of attempts\n")
stop = True
break
if stop:
break
question9 = "What is tau in english"
options9 = "a. Letter\nb. Number\nc. Space\nd. Shape\n"
print(question9)
print(options9)
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "b" or response == "B":
print ("Correct\n")
score = score + 1
break
else:
print("Wrong. Try again.\n")
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "b" or response == "B":
stop = True
score = score + 0.5
break
else:
print("Wrong. You ran out of attempts\n")
stop = True
break
if stop:
break
question10 = "What is wini in english"
options10 = "a. Win\nb. Lose\nc. Try again\nd. Quit\n"
print(question10)
print(options10)
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "a" or response == "A":
print ("CONGRATULATIONS YOU WIN\n")
score = score + 1
break
else:
print("Wrong. Try again.\n")
while True:
response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")
if response == "a" or response == "A":
print ("CONGRATULATIONS YOU WIN\n")
stop = True
score = score + 0.5
break
else:
print("Wrong. You ran out of attempts\n")
stop = True
break
if stop:
break
print ("Your score was", str (score)+"/10")