# GameMaths

Jan 11th, 2021
937
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. highscore = 0  #  initalising the high score
2.
3. while True:  #  keep going till false (an infinite loop)
4.   score = 0 #  initalising the score for each loop of the while loop
5.
6.   print("Welcome to the math quiz")  # play the game instructions
7.   print("Can you answer 3 questions??")
8.
9.   #Q1
10.   print("\nQ1.  What is the product of 2 x 2 x 2 ? >>")
11.
13.
14.   # Q1 checking
16.     print("yay, well done, correct")
17.     score +=1 # increase score by one (same as score = score +1)
18.     print(f"your score is {score}") # other ways of printing our
19.   else:
20.     print("sorry thats not correct :(")
22.
23.   #high score beaten??
24.   if score > highscore:
25.     highscore = score
26.   print(f"The current high score is>> {highscore}")
27.
28.   # Q2
29.   print("\nQ2.  What is the 4 MOD 2 ? (4%2) >>")
30.
32.
33.   # Q2 checking
35.     print("yay, well done, splendido")
36.     score +=1 # increase score by one (same as score = score +1)
37.     print(f"your score is {score}") # other ways of printing our
38.   else:
39.     print("sorry thats not correct :(")
41.
42.   #high score beaten??
43.   if score > highscore:
44.     highscore = score
45.   print(f"The current high score is>> {highscore}")
46.
47.   # Q3
48.   print("\nQ3.  What is 7//3 ?  >>")
49.
51.
52.   # Q3 checking