Python splitting list to sublists at given start/end keywords – stackoverflow.com

If I were to have a list, say lst = ['hello', 'foo', 'test', 'world', 'bar', 'idk'] I'd like to split it into a sublist with 'foo' and 'bar' as start and end keywords, so that I would get lst = ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "Python splitting list to sublists at given start/end keywords – stackoverflow.com"