logo CodeStepByStep logo

word_wrap3

Language/Type: Python file input

Modify the previous problem's word_wrap function into a new function word_wrap3 that only wraps whole words, never chopping a word in half. Assume that a word is any whitespace-separated token and that all words are under 60 characters in length.

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.