[EMAIL PROTECTED] wrote: > Cool ... and damn but you guys are fast with the answers. This appears > to work find, but in a quick and dirty test it appears that the [list] > version takes about 2x as long to run as the original loop. Is this > normal?
You could also do it 'functionally' with map(), but it's ugly and would probably fail (in this case) for non-unique list indicies; it is fast though. map(lambda x: tmp.extend([seq.index(x)]*x), seq) Ps. I don't know if xrange is faster...I thought the difference was that range created a temporary variable holding a range object and xrange created an iterator? Regards, Jordan -- http://mail.python.org/mailman/listinfo/python-list