Mega Code Archive

 
Categories / Python Tutorial / Statement
 

Simple Generator Features

def simpleGen():     yield 1     yield '2 --> punch!' myG = simpleGen() print myG.next()