Advertisement
francydafne

Course 1.0.3

Dec 12th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. highscore = 0
  2. while True:
  3.     score = 0
  4.    
  5. print ("Welcome to the Maths Quiz")
  6. print ("Can you answer three questions and score maximum points?")
  7. print ("Question 1: What is the product of 2x2x2?")
  8.  
  9. answer = int(input("Your answer :>> "))
  10. if answer == 8:
  11.     print ("Correct")
  12.     score = score + 1
  13.     print ("Your score is ", score)
  14. else:
  15.     print ("Incorrect, the answer is 8")
  16.     print ("Your score is ", score)
  17.  
  18. if score >= highscore:
  19.     highscore = score
  20. print ("The highscore is " + str(highscore))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement