Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- highscore = 0
- while True:
- score = 0
- print("Welcome to the Maths Quiz")
- print("")
- print("Can you answer three questions and score maximum points?")
- print("Question 1: What is the product of 2x2x2?")
- answer = int(input("Your answer :>> "))
- if answer == 8:
- print("")
- print("Correct")
- score = score + 1
- print("Your score is ", score)
- else:
- print("")
- print("Incorrect, the answer is 8")
- print("Your score is ", score)
- print("Question 2: What is the the answer of 125/25?")
- answer = int(input("Your answer :>> "))
- if answer == 5:
- print("")
- print("Correct")
- score = score + 1
- print("Your score is ", score)
- else:
- print(" ")
- print("Incorrect, the answer is 5")
- print("Your score is ", score)
- print("Question 3: What is the the answer of 4^3?")
- answer = int(input("Your answer :>> "))
- if answer == 64:
- print(" ")
- print("Correct")
- score = score + 1
- print("Your score is ", score)
- else:
- print(" ")
- print("Incorrect, the answer is 64")
- print("Your score is ", score)
- if score >= highscore:
- highscore = score
- print(" ")
- print("The highscore is " + str(highscore))
- print("")
- else:
- print(" ")
- print("The high score is "+str(highscore))
- print("")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement