Anonymous user
Ethiopian multiplication: Difference between revisions
→{{header|Python}}: Add subheadings
(→{{header|Object Pascal}}: no need to use inttostr) |
(→{{header|Python}}: Add subheadings) |
||
Line 2,328:
=={{header|Python}}==
===Python: With tutor===
<lang python>tutor = True
Line 2,371 ⟶ 2,372:
>>> </pre>
===Python: Without tutor===
Without the tutorial code, and taking advantage of Python's lambda:
Line 2,388 ⟶ 2,390:
return result</lang>
===Python: With tutor. More Functional===
Using some features which Python has for use in functional programming. The example also tries to show how to mix different programming styles while keeping close to the task specification, a kind of "executable pseudocode".
Note: While column2 could theoretically generate a sequence of infinite length, izip will stop requesting values from it (and so provide the necessary stop condition) when column1 has no more values.
|