Вы можете сделать что-то подобное в Google Colab с python встроенной библиотекой 'textwrap'
import textwrap
wrapper = textwrap.TextWrapper(width=40,
initial_indent=" " * 4,
subsequent_indent=" " * 4,
break_long_words=False,
break_on_hyphens=False)
string = "PURPOSE: To end world hunger, create peace for all people, solve all technological and scientific problems, make an exorbitant amount of money, and remain humble in the process."
print wrapper.fill(string)
output
PURPOSE: To end world hunger, create peace for all people, solve all
technological and scientific problems, make an exorbitant amount of money,
and remain humble in the process.