PyPK wrote: > lst = [1,1,1,1,3,5,1,1,1,1,7,7,7] > I want to group the list so that it returns groups such as > [(0,3),4,5,(6,9),(10,12)]. which defines the regions which are similar.
You'll probably want to use "groupby" from the itertools module. See http://docs.python.org/lib/itertools-functions.html -- Benji York -- http://mail.python.org/mailman/listinfo/python-list