import textwrap
doc = """The wrap() method is just like fill() except that it returns
a list of strings instead of one big string with newlines to separate
 the wrapped lines."""
print(textwrap.fill(doc, width=40))

输出

The wrap() method is just like fill()
except that it returns a list of strings
instead of one big string with newlines
to separate  the wrapped lines.

 

相关文章:

  • 2022-02-07
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-02-19
  • 2022-03-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
相关资源
相似解决方案