At 2008-12-15T20:03:14Z, "Chris Rebert" <c...@rebertia.com> writes:
> You just need a recursive list-flattening function. There are many > recipes for these. Here's mine: >>>> flattened = flatten([1,2,3,[5,6,[10, 11]],7,[9,[1, 2, 3, 4, 5 ]]]) >>>> flattened > [1, 2, 3, 5, 6, 10, 11, 7, 9, 1, 2, 3, 4, 5] >>>> '-'.join(str(num) for num in flattened) > '1-2-3-5-6-10-11-7-9-1-2-3-4-5' He doesn't want to flatten them directly. He's using [1,2,3] sort of like a regular expression, so that 1,[2,3],4 means "1,2,4" or "1,3,4", not "1,2,3,4". -- Kirk Strauser The Day Companies -- http://mail.python.org/mailman/listinfo/python-list