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. -- http://mail.python.org/mailman/listinfo/python-list