Hi George, Here's the result: >>> [list(group) for _,group in it.groupby("taaypiqee88adbbba")] [['t'], ['a', 'a'], ['y'], ['p'], ['i'], ['q'], ['e', 'e'], ['8', '8'], ['a'], ['d'], ['b', 'b', 'b'], ['a']] >>> [len(list(group)) for _,group in it.groupby("taaypiqee88adbbba")] [1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 3, 1] >>>
According to the above output, your solution is correct. Regards, Aries -- http://mail.python.org/mailman/listinfo/python-list