Python splitting list to sublist at start and end keyword patterns – stackoverflow.com

If I were to have a list, say: lst = ['foo', 'bar', '!test', 'hello', 'world!', 'word'] with a character of !, how would I return a list given: lst = ['foo', 'bar', ['test', 'hello', 'world'], '...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

0 Comment to "Python splitting list to sublist at start and end keyword patterns – stackoverflow.com"