def add_numbers(a, b):
    return a + b

def subtract_numbers(a, b):
    return a - b

def multiply_numbers(a, b):
    return a * b

def divide_numbers(a, b):
    if b == 0:
        return "Error: Division by zero is not allowed."
    else:
        return a / b

while True:
    answer = input("Do you want to follow mathematical instructions? (yes/no) ")
    if answer.lower() == "yes":
        print("Following mathematical instructions...")
        operation = input("Choose an operation: (add/subtract/multiply/divide) ")
        if operation.lower() == "add":
            num1 = float(input("Enter the first number: "))
            num2 = float(input("Enter the second number: "))
            result = add_numbers(num1, num2)
            print("Result:", result)
        elif operation.lower() == "subtract":
            num1 = float(input("Enter the first number: "))
            num2 = float(input("Enter the second number: "))
            result = subtract_numbers(num1, num2)
            print("Result:", result)
        elif operation.lower() == "multiply":
            num1 = float(input("Enter the first number: "))
            num2 = float(input("Enter the second number: "))
            result = multiply_numbers(num1, num2)
            print("Result:", result)
        elif operation.lower() == "divide":
            num1 = float(input("Enter the first number: "))
            num2 = float(input("Enter the second number: "))
            result = divide_numbers(num1, num2)
            print("Result:", result)
        else:
            print("Sorry, I didn't understand your operation. Please choose 'add', 'subtract', 'multiply', or 'divide'.")
    elif answer.lower() == "no":
        print("Stopping...")
        break
    else:
        print("Sorry, I didn't understand your answer. Please answer with 'yes' or 'no'.")

