Project math
(Re-)start
from random import randrange as slump yays = ["Yay!", "Keep going!", "You are good at this!", "Great!", "Super!"] number_of_correct_answers = 0 number_of_rounds = 0 print("Welcome to the Project Math, how many rounds do you want?\n\n") while(True): i_want_rounds = input() if i_want_rounds == "open-games-pro": print("You have found the secret menu:\n\nA. Humlas game\nB. Los game") elif i_want_rounds == "A" or i_want_rounds == "a": print("Humlas game, coming soon. Learn some times tables first") elif i_want_rounds == "B" or i_want_rounds == "b": print("Los game, coming soon. Learn some times tables first") else: i_want_rounds = int(i_want_rounds) if i_want_rounds < 36: break print("Tooooo much!") while(number_of_rounds < i_want_rounds): number_of_rounds = number_of_rounds + 1 #first = 9 first = slump(11) second = slump(11) correct_answer = first * second print(f"({number_of_rounds}/{i_want_rounds}) How much is {first} * {second}?\n") while True: try: users_answer = int(input()) break except ValueError: pass if users_answer == correct_answer: pepp = slump(len(yays)) print(f"{first} * {second} = {users_answer}, {yays[pepp]}") number_of_correct_answers = number_of_correct_answers + 1 else: print("Nah, you failed") print(f"Score: {number_of_correct_answers} / {number_of_rounds}\n") percent_correct = int(100.0 * number_of_correct_answers / number_of_rounds) print(f"You finished all the questions.\nYour final score: {number_of_correct_answers} ({percent_correct}%)\n\nDid you like this game?") like = input() if like == "no" or like == "No": like = input("Why? ") print(f"{like}, ok thank you!")