Using regex to split list of strings into list of lists based on starting character

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Using regex to split list of strings into list of lists based on starting character



I have a very long list of 9000+ elements. For example Sample is below:


lst = ['0sbsd uu', '7fsfss us', 'Bsfsd ll', 'Zufss dl', 'fasfs ff', '8fsdr2 us', 'It fss', 'Fsffsfds f']



I have to split lst into a list of 15 "almost" equal size sublists such that each sublist contains all the entries starting with a given character range (say 0 - c, d - h, ....).


lst


0 - c, d - h, ....









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Visual Studio Code: How to configure includePath for better IntelliSense results

Spring cloud config client Could not locate PropertySource

Makefile test if variable is not empty