I have made a General Knowledge quiz in python as a project from my school
import time
score=int()
print("Welcome to the General knowledge Quesions Quiz")
time.sleep(2)
print("Question 1")
time.sleep(2)
Question1 = input ("A vehicle with the national registration code ‘PK’ would originate from which country? ")
if Question1 == ("Pakistan") or Question1 == ("pakistan"):
print("Correct answer")
score = score + 1
else:
print("Incorrect answer, the correct answer is Pakistan")
time.sleep(2)
print("Question 2")
time.sleep(2)
Question2 = input("In which English county is Blenheim Palace? ")
if Question2 == ("Oxfordshire") or Question2 == ("oxfordshire"):
print("Correct answer")
score = score + 1
else:
print("Incorrect answer, the correct answer is Oxfordshire")
time.sleep(2)
print("Question 3")
time.sleep(2)
Question3 = input("How many hours are there in a leap year? ")
if Question3 == ("8784"):
print("Correct answer")
score = score + 1
else:
print("Incorrect answer, the correct answer is 8784")
time.sleep(2)
print("Question 4")
time.sleep(2)
Question4 = input("In which sport could you win the Davis Cup? ")
if Question4 == ("Tennis") or Question4 == ("tennis"):
print("Correct answer")
score = score + 1
else:
print("Incorrect answer, the correct answer is Tennis")
time.sleep(2)
print("Question 5")
time.sleep(2)
Question5 = input("What is the capital of Afghanistan? ")
if Question5 == ("Kabul") or Question5 == ("kabul"):
print("Correct answer")
score = score + 1
else:
print("Incorrect answer, the correct answer is Kabul")
time.sleep(2)
print("Question 6")
time.sleep(2)
Question6 = input("How many golden stars feature on the flag of the European Union? ")
if Question6 == ("twelve") or Question6 == ("Twelve") or Question6 == ("12"):
print("Correct answer")
score = score + 1
else:
print("Incorrect answer, the correct answer is twelve")
time.sleep(2)
print("Question 7")
time.sleep(2)
Question7 = input("In which year did Channel 4 begin transmission in the UK? ")
if Question7 == ("1982"):
print("Correct answer")
score = score + 1
else:
print("Incorrect answer, the correct answer is 1982")
time.sleep(2)
print("Question 8")
time.sleep(2)
Question8=input("In which year did Theresa May become Prime Minister? ")
if Question8 == ("2016"):
print("Correct answer")
score = score + 1
else:
print("Incorrect answer, the correct answer is 2016")
time.sleep(2)
print("Question 9")
time.sleep(2)
Question9 = input("What is six-fourteenths of 112? ")
if Question9 == ("48") or Question9 == ("forty eight"):
print("Correct answer")
score = score + 1
else:
print("Incorrect asnwer, the correct answer is 48")
time.sleep(2)
print("Question 10")
time.sleep(2)
Question10 = input("Which type of angle is greater than 90 degrees but less than 180 degrees? ")
if Question10 == ("obtuse") or ("Obtuse"):
print("Correct answer")
score = score + 1
time.sleep(2)
print("This is the end of the quiz")
time.sleep(1)
print("You got",(score),"/ 10")
num1 = (score)
num2 = 10
print('{0:.2f}%'.format((num1 / num2 * 100)))
I have finished the quiz and if anyone has any suggestions on how I could have improved it, they will be greatly appreciated. So please suggest how I can improve it!
Thanks :)