xavicano

Untitled

May 11th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.14 KB | None | 0 0
  1. highscore = 0
  2. while True:
  3.     score = 0
  4.     print("Welcome to the Maths Quiz")
  5.     print("Can you answer three questions and score maximum points?")
  6.     print("Question 1: What is the product of 2x2x2?")
  7.     answer = int(input("Your answer :>> "))
  8.     if answer == 8:
  9.         print("Correct")
  10.         score = score + 1
  11.         print("Your score is ", score)
  12.     else:
  13.         print("Incorrect, the answer is 8")
  14.         print("Your score is ", score)
  15.     print("Question 2: What is the product of 2³?")
  16.     answer = int(input("Your answer :>> "))
  17.     if answer == 8:
  18.         print("Correct")
  19.         score = score + 1
  20.         print("Your score is ", score)
  21.     else:
  22.         print("Incorrect, the answer is 8")
  23.         print("Your score is ", score)
  24.     print("Question 3: What is the product of square root of 64?")
  25.     answer = int(input("Your answer :>> "))
  26.     if answer == 8:
  27.         print("Correct")
  28.         score = score + 1
  29.         print("Your score is ", score)
  30.     else:
  31.         print("Incorrect, the answer is 8")
  32.         print("Your score is ", score)
  33.     if score >= highscore:
  34.         highscore = score
  35.     print("The highscore is " + str(highscore))
Advertisement
Add Comment
Please, Sign In to add comment