who said python can't be obsfucated!?

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Wed Apr 2 15:51:52 EDT 2008


cokofree...:
> def s(c):return[]if c==[]else s([_ for _ in c[1:]if _<c[0]])+[c[0]]+s([_ for _ in c[1:]if _>=c[0]])

That QuickSort can be written as a lambda too:

s=lambda l:[]if l==[]else s([x for x in l[1:]if x<l[0]])+[l[0]]+s([x
for x in l[1:]if x>=l[0]])

Bye,
bearophile



More information about the Python-list mailing list