def calculate_gain_loss(market, book):
    """Calculates the gain or loss of our holdings in both a
    dollar value and percentage"""
    gain_loss = []
    change = []
    length = len(market)
    for index in range(length):
        gain_loss.append('{:.2f}'.format(round(float(market[index]) - float
            (book[index]), 2)))
        change.append('{:.3f}'.format(round(float(gain_loss[index]) / float
            (book[index]), 3)))
    return gain_loss, change
