Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. highscore = 0
  2. while True:
  3.     score = 0
  4.     print("Welcome!")
  5.     print("1.")
  6.     print("2 + 2 = ")
  7.  
  8.     answer = int(input("Answer: "))
  9.  
  10.     if answer == 4:
  11.         print("Correct!")
  12.         score = score + 1
  13.         print("Score: ", score)
  14.  
  15.     else:
  16.         print("Incorrect!")
  17.         print("Score: ", score)
  18.  
  19.  
  20.     print("2.")
  21.     print("5 + 5 = ")
  22.  
  23.     answer = int(input("Answer: "))
  24.  
  25.     if answer == 10:
  26.         print("Correct!")
  27.         score = score + 1
  28.         print("Score: ", score)
  29.  
  30.     else:
  31.         print("Incorrect!")
  32.         print("Score:", score)
  33.  
  34.    
  35.     print("3.")
  36.     print("10 + 2 = ")
  37.  
  38.     answer = int(input("Answer: "))
  39.  
  40.     if answer == 12:
  41.         print("Correct!")
  42.         score = score + 1
  43.         print("Score: ", score)
  44.  
  45.     else:
  46.         print("Incorrect!")
  47.         print("Score: ", score)
  48.  
  49.  
  50.     if score >= highscore:
  51.         highscore = score
  52.     print("Highscore: ", highscore)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement