removing common elemets in a list
Michael Bentley
michael at jedimindworks.com
Wed May 16 15:50:31 EDT 2007
On May 16, 2007, at 10:36 AM, John Zenger wrote:
> On May 16, 2:17 am, saif.shak... at gmail.com wrote:
>> Hi,
>> Suppose i have a list v which collects some numbers,how do i
>> remove the common elements from it ,without using the set() opeartor.
>> Thanks
>
> Submit this as your homework answer -- it will blow your TA's mind!
>
> import base64
> def uniq(v):
> return
> eval(base64.b64decode
> ('c29ydGVkKGxpc3Qoc2V0KHYpKSxrZXk9bGFtYmRhIHg6di5pbmRleCh4KSk='),local
> s())
Nice! But I think he said he couldn't use set() ;-)
More information about the Python-list
mailing list