I need help.
Code:
def split(lst, n):
n = min(n, len(lst))
k, m = divmod(len(lst), n)
for i in range(n):
yield lst[i*k+min(i, m):(i+1)*k+min(i+1, m)]
siemak = "I look around at my culture, at the ways that people treat each other and at the ways that people treat the land, and I feel that we live in one of those times when language is closed and guarded by gatekeepers. I read Thoreaus Walden and realize that the language we use to speak of the natural world, and of our relationship with the natural world, has changed very little in 150 years. And if the language we use to speak of the natural world is not innovative and engaging then is it any wonder that few young people get excited about nature? I feel that the time has come for language to shine again, to bloom like a flower and lead the way as we begin to speak confidently about the future we want. But this can only happen when we create new words that will serve as vessels for new ideas and new dreams. Long-stable systems and stale old conventions are already breaking down before our eyes, and in the midst of this teetering balance we have an amazing opportunity to rebuild our culture and our relationship with the natural world through language."
porto = list(split(siemak,20))
print(porto)
Result:
['I look around at my culture, at the ways that people ', 'treat each other and at the ways that people treat th', 'e land, and I feel that we live in one of those times', ' when language is closed and guarded by gatekeepers. ', 'I read Thoreaus Walden and realize that the language ', 'we use to speak of the natural world, and of our rela', 'tionship with the natural world, has changed very lit', 'tle in 150 years. And if the language we use to speak', ' of the natural world is not innovative and engaging ', 'then is it any wonder that few young people get excit', 'ed about nature? I feel that the time has come for la', 'nguage to shine again, to bloom like a flower and lea', 'd the way as we begin to speak confidently about the ', 'future we want. But this can only happen when we crea', 'te new words that will serve as vessels for new ideas', ' and new dreams. Long-stable systems and stale old co', 'nventions are already breaking down before our eyes, ', 'and in the midst of this teetering balance we have an', ' amazing opportunity to rebuild our culture and our r', 'elationship with the natural world through language.']
How to move the last parts of a word to the next line so that they form correct words???
Maybe another solution??? Thanks.