logo CodeStepByStep logo


Language/Type: Python file input

Modify the previous problem's word_wrap function into a new function word_wrap2 that accepts two parameters representing an input file and an output file name, and outputs the newly wrapped text from the input file to the given output file. Also, modify it to use a constant for the maximum line length rather than hard-coding 60.

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.