On the road....

On the road....

本命:張國榮
副本命:KinKi Kids

現居地:Toronto, Canada

Amebaでブログを始めよう!

Lazy-evaluation:

The code is run by once or never ben run. 

It is also called call-by-need, since only the code is needed, it would be called. 

It reduced the amount of code that is excuted and save the momery. 

 

Strick-evaluation:

The code is run down in a order. 

 

example:

# generator solution
def even_integers_generator(n):
    for i in range(n):
        if i % 2 == 0:
            yield i