Create a Quiz Program With Python:-
print("\n")
score=0
user=input("Do you want play the quiz ? ")
if (user=='y' or user=='Y'):#user can press y or Y
print("\nLets play!!\n")
else:
print("See you Next Time")#if user press No then this msg display
exit()#and program will stop
Q1=input('Q1. What is the full form of C.P.U ?\nA. Centeral Process Unit.\nB. Central Processing Unit.\nYour Answer:-')
if(Q1=='b' or Q1=='B'):
print("Correct\n")
score+=1
else:
print("you are wrong\n")
Q2=input("Q1. What is the full form of A.L.U ?\nA. Airthmatic Logic Unit.\nB. Airclock Logic Unit.\nYour Answer:- ")
if(Q2=='a' or Q2=='A'):
print("Correct\n")
score+=1
else:
print("you are wrong\n")
Q2=input("Q1. How many hours in a day ?\nA. 24 hours.\nB. 23 hours.\nYour Answer:- ")
if(Q2=='a' or Q2=='A'):
print("Correct\n")
score+=1
else:
print("you are wrong\n")
q3=input("a for:-\nA.apple\nB.egg\nYour answer:- ")
if (q3=='a' or q3=='A'):
print("correct")
score+=1
else:
print("wrong")
print("Your Score is",score,"out of 4.\nThanks!!")
exit()