def calc_prefix(_str, n):
    """
    Return an n charaters prefix of the argument string of the form
    'prefix...'.
    """
    
    if len(_str) <= n:
        return _str

    return _str[: (n - 3)] + '...'