"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 09:58:35.450729
"""

```python
from typing import Callable, Any

class FallbackExecutor:
    """
    A class for creating a fallback executor that attempts to run a given function.
    If an error occurs during execution, it tries an alternative function as a fallback.

    :param primary_func: The primary function to execute. It should accept keyword arguments.
    :param fallback_func: The fallback function to use if the primary function fails. It should accept same keyword arguments as primary_func.
    """

    def __init__(self, primary_func: Callable[..., Any], fallback_func: Callable[..., Any]):
        self.primary_func = primary_func
        self.fallback_func = fallback_func

    def execute(self, **kwargs) -> Any:
        """
        Executes the primary function. If an error occurs, it attempts to use the fallback function.
        
        :param kwargs: Keyword arguments passed to both the primary and fallback functions if needed.
        :return: The result of the executed function or None in case of unrecoverable error.
        """
        try:
            return self.primary_func(**kwargs)
        except Exception as e:
            print(f"Primary function failed with exception: {e}")
            try:
                return self.fallback_func(**kwargs)
            except Exception as fe:
                print(f"Fallback function also failed with exception: {fe}")
                return None


# Example usage
def divide(a: float, b: float) -> float:
    """Divides two numbers."""
    return a / b

def safe_divide(a: float, b: float) -> float:
    """Safe division that handles division by zero."""
    if b == 0:
        print("Division by zero - returning zero.")
        return 0.0
    return a / b


fallback_executor = FallbackExecutor(primary_func=divide,
                                     fallback_func=safe_divide)

# Test the functionality
result = fallback_executor.execute(a=10, b=2)
print(f"Result of division: {result}")  # Should be 5.0

result = fallback_executor.execute(a=10, b=0)
print(f"Result of safe division when dividing by zero: {result}")  # Should print "Division by zero - returning zero." and then 0.0
```