Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python generator

# A recursive generator that generates Tree leaves in in-order.
def inorder(t):
    if t:
        for x in inorder(t.left):
            yield x

        yield t.label

        for x in inorder(t.right):
            yield x
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #python #generator
ADD COMMENT
Topic
Name
3+4 =