def copy_to_len_whole(s, l):
    """Returns the maximum length string made of copies of `s` with the length
    at most `l`.

    Parameters
    ----------
    s : string
        String to be copied.
    l : int
        how many times `s` should be copied.

    Returns
    -------
    output : string
        Copies of `s` stuck together with length at most `l`.
    """

    # Initialisations
    s_list = [ ]
    output_list = [ ]
    
    for i in range(len(s)):
        s_list.append(s[i])
    
    while len(output_list) < l - len(s_list):
        output_list += s_list
        
    if l - len(output_list) == len(s_list):
        output_list += s_list
        
    output = "".join(output_list)
    
    return output