def apply_opcode4(code_list, opcode_loc, parameter_mode_dict):
    """When you've determined that the opcode is 4 - which means to return a
    value in the location of its only parameter as an output - you can use this
    function to adjust code_list.

    Parameters
    ----------
    code_list : list
        The opcode
    opcode_loc : int
        The index of the opcode in code_list
    parameter_mode_dict : dict
        A dictionary indicating for the following value after an opcode of 3
        whether they should be considered in position (0) or immediate (1)
        modes

    Returns
    -------
    code_list : list
        The whole programme
    output : int
        The value in the location determined by the parameter of the opcode
    """

    opcode, param1 = code_list[opcode_loc:opcode_loc+2]

    # If the mode is 1 then the parameter should be interpreted as it stands.
    # If the mode is 0 then we need to get the value at that location in the
    # code list
    if parameter_mode_dict[1] == '0':
        param1 = code_list[param1]

    # Return that value as an output
    output = param1

    return code_list, output