"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-08 07:31:19.592150
"""

```python
from typing import Callable, Any, Optional

class FallbackExecutor:
    """
    A class for executing functions with fallbacks in case of errors.
    
    Args:
        primary_function (Callable[..., Any]): The function to attempt execution.
        backup_function (Optional[Callable[..., Any]]): The function to execute if `primary_function` fails. Defaults to None.
    """
    def __init__(self, primary_function: Callable[..., Any], backup_function: Optional[Callable[..., Any]] = None):
        self.primary_function = primary_function
        self.backup_function = backup_function

    def execute_with_fallback(self, *args: Any, **kwargs: Any) -> Any:
        """
        Attempts to execute the `primary_function`. If an exception occurs during execution,
        it will attempt to execute `backup_function` if provided.
        
        Args:
            *args: Positional arguments to pass to the functions.
            **kwargs: Keyword arguments to pass to the functions.

        Returns:
            The result of the executed function or None in case both functions failed.
        """
        try:
            return self.primary_function(*args, **kwargs)
        except Exception as e:
            if self.backup_function is not None:
                print(f"Primary function failed: {e}")
                try:
                    return self.backup_function(*args, **kwargs)
                except Exception as backup_e:
                    print(f"Backup function also failed: {backup_e}")
            else:
                print(f"No fallback available. Primary function failed with: {e}")

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

def safe_divide(a: int, b: int) -> float:
    """Safe division function that returns 0 if division by zero occurs."""
    try:
        return a / b
    except ZeroDivisionError:
        print("Caught division by zero. Returning 0.")
        return 0.0

fallback_executor = FallbackExecutor(primary_function=divide, backup_function=safe_divide)
result = fallback_executor.execute_with_fallback(10, 2)  # Normal execution with successful primary function
print(result)

result = fallback_executor.execute_with_fallback(10, 0)  # Execution with an error in the primary function handled by backup
print(result)
```