In brief
textwrap.wrap() returns lines constrained by a chosen width. textwrap.fill() joins them into a string with line breaks, useful for console help text.
Useful to know
textwrap.wrap() returns lines constrained by a chosen width. textwrap.fill() joins them into a string with line breaks, useful for console help text. [1]
The width is a text-formatting rule, not a browser pixel measurement. Check behaviour with long words and existing whitespace. A web page’s CSS layout addresses a different problem and does not automatically follow the same boundaries.
Sources
For further detail and to check the information: