"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 08:39:41.441870
"""

```python
class FallbackExecutor:
    """
    A class that provides a fallback mechanism for executing functions.
    In case an initial function call fails, it attempts to execute a fallback function.

    :param func: The main function to be executed.
    :param fallback_func: The function to fall back to if the main function raises an error.
    """

    def __init__(self, func, fallback_func):
        self.func = func
        self.fallback_func = fallback_func

    def execute(self, *args, **kwargs) -> any:
        """
        Execute the main function or the fallback function based on success of execution.

        :param args: Positional arguments to pass to the functions.
        :param kwargs: Keyword arguments to pass to the functions.
        :return: The result of the executed function or its fallback.
        """
        try:
            return self.func(*args, **kwargs)
        except Exception as e:
            print(f"Error occurred in main function: {e}")
            return self.fallback_func(*args, **kwargs)

# Example usage
def divide_numbers(x: float, y: float) -> float:
    """Divide x by y."""
    return x / y

def safe_divide_numbers(x: float, y: float) -> float:
    """Fallback to return 0 if division by zero occurs."""
    return 0.0

# Create an instance of FallbackExecutor
fallback_executor = FallbackExecutor(divide_numbers, safe_divide_numbers)

result = fallback_executor.execute(10, 2)
print(result)  # Should print 5.0

result = fallback_executor.execute(10, 0)
print(result)  # Should print 0.0 due to division by zero
```