Talk:Ethiopian multiplication: Difference between revisions

→‎python lambda: new section
(Ethiopian???)
(→‎python lambda: new section)
Line 75:
 
Same "shift", different pile.[[Special:Contributions/24.85.131.247|24.85.131.247]] 03:50, 9 November 2011 (UTC)
 
== python lambda ==
 
what is the point of doing:
<lang Python>halve = lambda x: x // 2
double = lambda x: x*2
even = lambda x: not x % 2</lang>
instead of:
<lang Python>def halve(x):
return x//2
def double(x):
return x*2
def even(x):
return not x % 2</lang>
if a named function is needed, it doesn't seem to make much sense to use lambda to create it.
lambda is useful for cases where an unnamed function is preferred.--[[User:EMBee|eMBee]] 07:35, 5 January 2012 (UTC)
Anonymous user