Visualize a tree: Difference between revisions

Line 1,975:
===Functional composition===
{{Trans|JavaScript}} (Plain Text version)
<lang python>from operatoritertools import (addrepeat, starmap)
from operator import itertools(add)
 
 
Line 1,987:
def draw(node):
def shift(first, other, xs):
return list(itertools.starmap(
add,
zip(
[first] + list(itertools.repeat(other, len(xs) - 1)),
xs
)
9,659

edits