Anonymous user
Ethiopian multiplication: Difference between revisions
→{{header|Python}}: Use takewhile
(→{{header|Python}}: Use takewhile) |
|||
Line 2,388:
return result</lang>
<lang python>from itertools import izip, takewhile
halve = lambda x: x // 2
Line 2,396:
even = lambda x: x % 2 == 0
def
arg =
halver =
doubler =
def ethiopian(multiplier, multiplicand):
|