def pv(cash_flow, period, cost_of_capital):
    """
    Input: cash_flow, year, cost_of_capital
    Output: present value of cash_flow
    """
    return cash_flow / (1.0 + cost_of_capital) ** period
