+ 2
Can anyone explain why 'very' and 'long' didn't fit the width 8?. Thanks in Advance 😊
7 Respuestas
+ 5
Try to place in longer words, it will break properly 👍
+ 2
lpang , I purposely checked using repeated words, because the repeated word doesn't fit to the width. I was confused by that.
+ 2
Surya T don't forget to count the " ".
If you try wrap.(string, 9) then "very very" and "very long" will wraped together.
+ 2
Yes, Thanks for the answer😊
+ 1
But is it clear now?
0
Okay bro 👌
0
import textwrap
string = "This is very very very long long string."
print(textwrap.wrap(string,9))
Use this it is showing in one line now 😅