# checks for an integer between the high and low def int_check(question, low, high): while True: error = f"💡 Hint 💡 Please enter an integer more than {low} and below {high}" to_check = input(question) try: response = int(to_check) # checks that the number is equal or more if low <= response <= high: return response else: print(error) except ValueError: print(error) # Main routine starts here # Ask user for the number of questions num_questions = int_check("How many questions would you like? Please choose between 1 and 15 ", 1, 15) print("You chose: ", num_questions)