Visualize a tree: Difference between revisions
m
→Python – Functional composition
Line 1,976:
===Functional composition===
{{Trans|Javascript}}
<lang python>from operator import (add)
import itertools
# drawTree :: Tree String -> String
def drawTree(tree):
return '\n'.join(draw(tree))
Line 2,026 ⟶ 2,030:
'type': 'Node'}
print(
)</lang>
{{Out}}
|