Help, I'm a beginner in coding! I have to write a quiz. You don't have to get all fancy and stuff, since I'm a beginner lol. I will give you brainliest if I your answer is helpful!!!


Your quiz program must have the following items:


1. It must start by asking the user what their name is and welcoming them to your quiz. It pays to be polite!

2. Set up a variable to keep score. It is up to you how to design the points system. Will you give them 10 points for a correct answer and 0 for an incorrect answer? Or perhaps you will be tough and take away points for an incorrect answer!

3. Ask your 10 quiz questions. If they get a question wrong, be sure to tell the user what the correct answer was. Then, adjust the score appropriately, depending on whether their answer was right or wrong.

4. At the end of the program, tell the user their score.


NOTE: For the 10 quiz questions, you can just write "put the question here" for me, and I will just add all 10.

Respuesta :

name = input("What's your name? ")

print("Hello " + name + ", welcome to my quiz!")

score = 0

di = {"qustion1": "answer1", "qustion2": "answer2", "qustion3": "answer3", "qustion4": "answer4", "qustion5": "answer5", "qustion6": "answer6",

     "qustion7": "answer7", "qustion8": "answer8", "qustion9": "answer9", "qustion10": "answer10"}

for x in di:

   user_answer = input(x+" ")

   if user_answer == di[x]:

       print("That's correct!")

       score += 1

   else:

       print("The correct answer is " + str(di[x]))

print("You got "+str(score)+" out of 10!")

I iterated through a dictionary with the questions and answers as the keys and values respectively. I hope this helps!

ACCESS MORE
EDU ACCESS