Ethiopian multiplication: Difference between revisions

m
Line 2,389:
 
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: AlthoughWhile column2 could theoretically generate a sequence of infinite length, izip will stop producing values (and so provide the necessary stop condition) when any of the iterables given as arguments (in this case column1) havehas no more values.
When not using the tutor, table will begenerate athe generator,table whichon isthe efficientfly andin doesan efficient way, not storekeeping any intermediate values.
 
<lang python>tutor = True
Anonymous user