Anonymous user
Ethiopian multiplication: Difference between revisions
→Python: With tutor. More Functional: Consolidated if statements
(→{{header|Python}}: Add subheadings) |
(→Python: With tutor. More Functional: Consolidated if statements) |
||
Line 2,428:
def column2(x): return iterate(double, x)
def rows(x, y): return izip(column1(x), column2(y))
if tutor: show_heading(multiplier, multiplicand)▼
table = rows(multiplier, multiplicand)
if tutor:
show_table(table)
result = sum(q for p, q in table if not even(p))
if tutor:
show_result(result)
return result</lang>
|