Set consolidation: Difference between revisions

→‎Python: Functional: Updated a docstring
(→‎Python: Functional: paired inputs with display of outputs)
(→‎Python: Functional: Updated a docstring)
Line 1,955:
def tabulated(s):
'''Heading -> x display function -> fx display function ->
number of columns -> f -> value list -> tabular string.'''
def go(xShow, fxShow, f, xs):
w = max(map(lambda x: compose(len)(xShow(x)), xs))
return s + '\n' + '\n'.join([
xShow(x).rjust(w, ' ') + ' -> ' + fxShow(f(x)) for x in xs
9,655

edits