File size: 255 Bytes
5cd3fef
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
def to_limit(multi_set: list[str], limit: int = 3) -> list[str]:
    if len(multi_set) >= limit:
        return multi_set[:limit]
    idx = 0
    while len(multi_set) < limit:
        multi_set.append(multi_set[idx])
        idx += 1
    return multi_set