
    Write a function that calculates the investment loss for a client's portfolio asset by determining the difference between the initial investment amount and its selling value, returning the loss amount only if the asset was sold at a lower price than purchased, otherwise return 0.
    

    
def loss_amount(actual_cost, sale_amount):
    """
    Write a function that calculates the investment loss for a client's portfolio asset by determining the difference between the initial investment amount and its selling value, returning the loss amount only if the asset was sold at a lower price than purchased, otherwise return 0.
    

    """
def loss_amount(actual_cost, sale_amount):
    """
    Write a function that calculates the investment loss for a client's portfolio asset by determining the difference between the initial investment amount and its selling value, returning the loss amount only if the asset was sold at a lower price than purchased, otherwise return 0.
    

    """
    if sale_amount > actual_cost:
        amount = sale_amount - actual_cost
        return amount
    else:
        return 0