Answer the question
In order to leave comments, you need to log in
How to add a line break?
There is a line with text, how to implement word wrapping to a new line with n characters, but the wrapping should not divide the word, i.e. wrap only on "spaces"
It should be something like this:
my_str = "Lorem Ipsum Lorem Ipsum"
perenos = 15
.
.
.
print(result)
Ожидаемый результат:
Lorem Ipsum\nLorem Ipsum
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question