Python : How to make a quiz and check if the answer is correct?
<p>I'm taking a computer science course and I recently took a test and there was a question whose answer I did not know  and I want to know how to do it.</p>

<p>The Question/problem was Ask the user 7 questions. Then check how many were correct and then give a percentage. I am familiar with input and operators and variables but I do not understand how to check if the answer the user inputed was correct and how to calculate how many were correct and how many were incorrect</p>

<p>Ive Done It, Code of What I Did Below:</p>

<p>q1=int(input("What Is 5+1 "))
if q1==6:
    print ("Correct")
    corr1=int(1)
else:
    print ("Wrong, The Answer Is: 6")
    corr1=int(0)</p>

<p>q2=int(input("What Is 6+9 "))
if q2==15:
    print ("Correct")
    corr2=int(1)
else:
    print ("Wrong, The Answer Is: 115")
    corr2=int(0)</p>

<p>q3=int(input("What Is 54+4 "))
if q3==58:
    print ("Correct")
    corr3=int(1)
else:
    print ("Wrong, The Answer Is: 58")
    corr3=int(0)</p>

<p>q4=int(input("What Is 43+9 "))
if q4==52:
    print ("Correct")
    corr4=int(1)
else:
    print ("Wrong, The Answer Is: 52")
    corr4=int(0)</p>

<p>q5=int(input("What Is 67+9 "))
if q5==76:
    print ("Correct")
    corr5=int(1)
else:
    print ("Wrong, The Answer Is: 76")
    corr5=int(0)</p>

<p>q6=int(input("What Is 64+14 "))
if q6==78:
    print ("Correct")
    corr6=int(1)
else:
    print ("Wrong, The Answer Is: 78")
    corr6=int(0)</p>

<p>q7=int(input("What Is 44+3 "))
if q7==47:
    print ("Correct")
    corr7=int(1)
else:
    print ("Wrong, The Answer Is: 47")
    corr7=int(0)</p>

<p>correct=corr1+corr2+corr3+corr4+corr5+corr6+corr7
print("You Scored %s/7" %(correct))</p>

<p>per=int(correct/7*100)</p>

<p>if per>=50:
    print("Congratulations You Passed With A %s Percent" % (per))
else:
    print("Oh No You Did Not Pass The Test And Scored A %s Percent, Try Harder Next Time!" %(per)) </p>

python input