import random def int_check(value1, value2): error = f"please enter an integer between {value1} & {value2}." while True: try: response = int(input("How many cards would you like to be dealt? (pick between 5 and 10)")) if response < value1 or response > value2: print(error) else: return response except ValueError: print(error) def yes_no(question): print(f"{question}") while True: yn = input("").lower() if yn in ["yes", "y"]: return True break elif yn in ["no", "n"]: return False break else: print("please enter yes/no") continue def int_check(value1, value2): error = f"please enter an integer between {value1} & {value2}." while True: try: response = int(input(f"How many questions would you like to be asked? (pick between {value1} and {value2})")) if response < value1 or response > value2: print(error) else: return response except ValueError: print(error) #game loop print("WELCOME TO THE MULTIPLICATION QUIZ") name = input("What's your name?") if yes_no(f"Hi {name}, would you like to read the rules?"): print("Rules:") print("The game will give you an amount of multiplication questions that you choose (between 10 and 30)") int_check(10, 30)