def calculate_product(a, b):
    return pow(a, b)

# Test the function
print("Enter two numbers:", end=' ')
num1 = float(input())
print("Product of", num1, "and", num2, ": ", calculate_product(num1, num2))


def calculate_product(a, b):
    while True:
        num1 = float(input("Enter first number: "))
        num2 = float(input("Enter second number: "))

        if not (num1 >= 0 and num2 <= 0) or num1 == 0 or num2 == 0:
            print("Please enter numbers.")
            continue

        # Check whether both inputs are valid
        try:
            product = pow(num1, b - a) * pow(num2, a - b)
            return product
        except ZeroDivisionError:
            print("Both inputs must be positive numbers.")