On Oct 16, 11:41�pm, Paul Rubin <http://phr...@nospam.invalid> wrote: > Mensanator <mensana...@aol.com> writes: > > Thanks, but what I wanted was > > ['00','1','0','1','0','1111','00','1','0' '1']. > > � � >>> c = '001010111100101' > � � >>> list(''.join(g) for k,g in groupby(c)) > � � ['00', '1', '0', '1', '0', '1111', '00', '1', '0', '1'] > > is really not that unnatural.
I thought someone else had suggested this solution earlier. Oh yeah, some guy named Paul Rubin. At first, I thought I needed to keep the 1's and 0's in seperate lists, but now that I see this example, I'm rethinking that. Thanks, and thanks to Paul Rubin. -- http://mail.python.org/mailman/listinfo/python-list