Simple Generator Features : Yield : Statement PYTHON TUTORIALS


PYTHON TUTORIALS » Statement » Yield »

 

Simple Generator Features


def simpleGen():
    yield 1
    yield '2 --> punch!'

myG = simpleGen()
print myG.next()
print myG.next()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Statement
» Yield