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("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("Correct")
- score = score + 1
- print("Your score is ", score)
- else:
- print("Incorrect, the answer is 8")
- print("Your score is ", score)
- print("Question 2: What is the product of 2³?")
- answer = int(input("Your answer :>> "))
- if answer == 8:
- print("Correct")
- score = score + 1
- print("Your score is ", score)
- else:
- print("Incorrect, the answer is 8")
- print("Your score is ", score)
- print("Question 3: What is the product of square root of 64?")
- answer = int(input("Your answer :>> "))
- if answer == 8:
- print("Correct")
- score = score + 1
- print("Your score is ", score)
- else:
- print("Incorrect, the answer is 8")
- print("Your score is ", score)
- if score >= highscore:
- highscore = score
- print("The highscore is " + str(highscore))
Advertisement
Add Comment
Please, Sign In to add comment