Better solution

Bo M. Maryniuck b.maryniuk at forbis.lt
Wed Aug 21 11:59:14 CEST 2002


On Wednesday 21 August 2002 11:41, Michael Hudson wrote:
> versus:
> >>> a = range(10)
> >>> b = a
> >>> b[:] = [x for x in b if x % 2 == 0]
> >>> a, b
>
> ([0, 2, 4, 6, 8], [0, 2, 4, 6, 8])

Ah, links... Right.

-- 
Regards, Bogdan

In order to get a loan you must first prove you don't need it.





More information about the Python-list mailing list