"skorpio11 at gmail.com" <skorpio11 at gmail.com> writes: > Any suggestions would be appreciated Look at the docs of the groupby function in the itertools module.