Text Wrap

  • + 0 comments

    def wrap(string, max_width): count = 0 y = "" for i in string:

        if count == max_width:
            y = y + "\n"
            count = 0
    
        y += i
        count += 1
    
    return y