I have a list:
<code>ll=['the big grey fox','want to chase a squirell', 'because they are friends']
</code>
<code>ll=['the big grey fox','want to chase a squirell', 'because they are friends']
</code>
ll=['the big grey fox','want to chase a squirell', 'because they are friends']
I want to split the 2nd element, ll[1]
, into want to chase
and a squirell
.
I want to end up with:
<code>['the big grey fox','want to chase', ' a squirell', 'because they are friends']
</code>
<code>['the big grey fox','want to chase', ' a squirell', 'because they are friends']
</code>
['the big grey fox','want to chase', ' a squirell', 'because they are friends']
Note that the first element needs to be always split so that the last 10 characters are a new element of the list, immediately after the first n-10 char of the element before, so that the order of joined text is not altered.
I currently use: ll[:1],ll[1][:len(ll[1])-10], ll[1][-10:],ll[2:]
, but am sure there is a prettier way of doing this.
Any suggestions?