Write a function to generate cubes of numbers over time


In [5]:
def cubeGen(n):
    '''Generator function to yield cubes of numbers from 0 to n'''
    for i in xrange(n):
        yield i**3