On 30 Jan 2008 05:20:49 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Neil Cerutti" <[EMAIL PROTECTED]> writes: > > Or one can put on his bellbottoms, horn-rimmed glasses, and wear a mullet: > > > > i = 0 > > while i < len(a): > > if a[i] == 99: > > del a[i] > > else: > > i += 1 > > Quadratic time!! Yowch!! Back to the future: > > def rocket_science(xs): > for x in xs: > if x != 99: > yield x > > a[:] = list(rocket_science(a))
Heh. <lamely>It's probably a fairly peppy quadratic operation though.</lamely> Besides, wherever will I find plutonium or a bolt of lightning? -- Neil Cerutti <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list