Sololearn: Learn to Code
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1
questions = {q1:"a",q2:"c",q3:"b",q4:"a",q5:"d",q6:"d",q7:"a",q8:"a"} answers=ans.split(",") index=0 points=0 for i in questions: print(answers[index]) if answers[index]==questions [i]: print("Congrats!! Your answer is Correct\n") points = points + 1 print ("***************************************\n") else: print("Sorry!! Your answer is Wrong\nThe Correct answer is " + questions[i] + "\n") points = points - 1 print ("***************************************\n") index+=1 print ("Congrats!! " + name + " you have completed the quiz\n") The above code is considering answer as "a,c, b,d, a, ..... " And if user enters all 8 answers.
15th Feb 2021, 4:54 PM
Abhay
Abhay - avatar
0
Aysha what inputs are giving you wrong answer?
16th Feb 2021, 7:43 AM
Abhay
Abhay - avatar