Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Yield Expressions in python

yield_atom       ::=  "(" yield_expression ")"
yield_expression ::=  "yield" [expression_list | "from" expression]


#Using the yield operation in functions
def gen():  # defines a generator function
    yield 123

async def agen(): # defines an asynchronous generator function
    yield 123
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #Yield #Expressions #python
ADD COMMENT
Topic
Name
5+4 =