Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- highscore = 0
- while True:
- score = 0
- print("Welcome!")
- print("1.")
- print("2 + 2 = ")
- answer = int(input("Answer: "))
- if answer == 4:
- print("Correct!")
- score = score + 1
- print("Score: ", score)
- else:
- print("Incorrect!")
- print("Score: ", score)
- print("2.")
- print("5 + 5 = ")
- answer = int(input("Answer: "))
- if answer == 10:
- print("Correct!")
- score = score + 1
- print("Score: ", score)
- else:
- print("Incorrect!")
- print("Score:", score)
- print("3.")
- print("10 + 2 = ")
- answer = int(input("Answer: "))
- if answer == 12:
- print("Correct!")
- score = score + 1
- print("Score: ", score)
- else:
- print("Incorrect!")
- print("Score: ", score)
- if score >= highscore:
- highscore = score
- print("Highscore: ", highscore)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement