Handling 3 operands in an expression without raising an exception

giacomo boffi pecore at pascolo.net
Sun Sep 29 11:28:26 EDT 2013


Νίκος <nikos.gr33k at gmail.com> writes:

> IF it can also be written in one-line

def f(x,n,w):return(lambda y=f(x[::2],n/2,w[::2]),z=f(x[1::2],n/2,w[::2]):reduce(lambda x,y:x+y,zip(*[(y[k]+w[k]*z[k],y[k]-w[k]*z[k]) for k in range(n/2)])))()if n>1 else x

-- 
anch'io la penso come me, ma                     -- SteO153, in IHC



More information about the Python-list mailing list