Вот довольно простое и лаконичное решение с использованием регулярных выражений, оно, вероятно, не подойдет для вашей домашней работы, но должно быть достаточно понятно, почему ограничение использования модулей нежелательно:
import re
s = 'Text Processing. You are tired of seeing lines on your e-mail wrap because people type lines that are too long for your mail reader application. Create a program to scan a text file for all lines longer than 80 characters. For each of the offending lines, find the closest word before 80 characters and break the line there, inserting the remaining text to the next line (and pushing the previous next line down one). When you are done, there should be no lines longer than 80 characters.'
print '\n'.join(line.strip() for line in re.findall(r'.{1,80}(?:\s+|$)', s))
Результат:
Text Processing. You are tired of seeing lines on your e-mail wrap because
people type lines that are too long for your mail reader application. Create a
program to scan a text file for all lines longer than 80 characters. For each of
the offending lines, find the closest word before 80 characters and break the
line there, inserting the remaining text to the next line (and pushing the
previous next line down one). When you are done, there should be no lines longer
than 80 characters.
Ваш образец текста представляет собой одну строку, вы, вероятно, на самом деле хотите использовать что-то вроде этого:
def split_lines(text):
lines = text.split('\n')
regex = re.compile(r'.{1,80}(?:\s+|$)')
return '\n'.join(s.rstrip() for line in lines for s in regex.findall(line))