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!