Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. highscore = 0
  2. while True:
  3. score = 0
  4. print("Welcome to the Maths Quiz")
  5. print("")
  6. print("Can you answer three questions and score maximum points?")
  7. print("Question 1: What is the product of 2x2x2?")
  8. answer = int(input("Your answer :>> "))
  9. if answer == 8:
  10. print("")
  11. print("Correct")
  12. score = score + 1
  13. print("Your score is ", score)
  14. else:
  15. print("")
  16. print("Incorrect, the answer is 8")
  17. print("Your score is ", score)
  18.  
  19.  
  20. print("Question 2: What is the the answer of 125/25?")
  21. answer = int(input("Your answer :>> "))
  22. if answer == 5:
  23. print("")
  24. print("Correct")
  25. score = score + 1
  26. print("Your score is ", score)
  27. else:
  28. print(" ")
  29. print("Incorrect, the answer is 5")
  30. print("Your score is ", score)
  31.  
  32. print("Question 3: What is the the answer of 4^3?")
  33. answer = int(input("Your answer :>> "))
  34. if answer == 64:
  35. print(" ")
  36. print("Correct")
  37. score = score + 1
  38. print("Your score is ", score)
  39. else:
  40. print(" ")
  41. print("Incorrect, the answer is 64")
  42. print("Your score is ", score)
  43.  
  44.  
  45. if score >= highscore:
  46. highscore = score
  47. print(" ")
  48. print("The highscore is " + str(highscore))
  49. print("")
  50. else:
  51. print(" ")
  52. print("The high score is "+str(highscore))
  53. print("")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement