Text Wrap

  • + 0 comments

    def wrap(string, max_width): i = 0 wrapped = '' while i < len(string): wrapped = wrapped + string[i] i = i + 1 if i % max_width == 0: wrapped = wrapped + '\n'
    return wrapped