You are viewing a single comment's thread. Return to all 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
Seems like cookies are disabled on this browser, please enable them to open this website
Text Wrap
You are viewing a single comment's thread. Return to all 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