Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
brutimus
· 16y ago · 0 comments
I don't understand the argument either.. I use multi-line lambdas with ifs and forloops all the time.
f = lambda x:( x if ( x**2 > 10 or x**2 < 5 ) else x**3 )
Comments
[–]
cturner
16y ago
I don't think you can assign variables in these blocks, nor do sequential statements. Imagine you wanted to reduce a list, and then do something on it. Print statements don't work either.