def chop(s: str, n: int):
    """Chop string *s* in pieces of length *n*. The last piece may be shorter than *n*."""
    i = 0
    result = []
    while i < len(s):
        result.append(s[i:i+n])
        i += n
    return result