def normalize(vec):
    """
    From a length-3 vector return a normalized vector

    :param vec: a subscriptable collection of length 3
    :return norm_vec: a subscriptable collection
    """

    # Calculate the length of the vector
    vec_len = float(vec[0] + vec[1] + vec[2])
    # Divide the components of vec by the length of the vector
    norm_vec = [vec[0] / vec_len, vec[1] / vec_len, vec[2] / vec_len]

    return norm_vec