Multiplication tables: Difference between revisions

→‎{{header|Python}}: Labelled the procedural and functional variants
(→‎{{header|Python}}: For comparison, added an equivalent list monad version to the list comprehension expression)
(→‎{{header|Python}}: Labelled the procedural and functional variants)
Line 4,095:
 
=={{header|Python}}==
===Procedural===
<lang python>>>> size = 12
>>> width = len(str(size**2))
Line 4,129 ⟶ 4,130:
<small>(As would using ASCII minus, plus, and pipe characters: "-", "+", "|"; instead of the non-ASCII chars used to draw a frame)</small>.
 
===Functional===
 
Or,We ascan define a stringmultiplication definedtable string first byin terms of a '''list comprehension''' (''mulTable'' function),
 
and then again, for comparison, byas an equivalent '''list monad''' expression (''mulTable2'' function):
 
<lang python>'''Multiplication table
9,659

edits