Visualize a tree: Difference between revisions

m
→‎Simple decorated-outline tree: Use itertools.chain in place of list construction and concatenation.
m (→‎{{header|Sidef}}: Fix link: Perl 6 --> Raku)
m (→‎Simple decorated-outline tree: Use itertools.chain in place of list construction and concatenation.)
Line 3,420:
<lang python>'''Visualize a tree'''
 
from itertools import (chain, repeat, starmap)
from operator import (add)
 
Line 3,438:
add,
zip(
chain([first], +repeat(other, listlen(xs) - 1)),
repeat(other, len(xs) - 1)
),
xs
)
Anonymous user