def repeat(text: str, /, up_to: int) -> str:
    """
    >>> repeat("concours", up_to=18)
    'concoursconcoursco'
    >>> repeat("lazone", up_to=4)
    'lazo'
    """
    result = ""
    char_index = 0
    while len(result) < up_to:
        result += text[char_index]
        char_index += 1
        if char_index == len(text):
            char_index = 0
    return result