If you need help reviewing Environment Diagrams, take a look at these resources:
Each question has a "Toggle Solution" button -- click it to reveal that question's solution.
def funny(joke): hoax = joke + 1 return funny(hoax) def sad(joke): hoax = joke - 1 return hoax + hoax funny, sad = sad, funny result = funny(sad(1)) # pay special attention to the names of # the frames!
def double(x): return double(x + x) first = double def double(y): return y + y result = first(10)
def fun(fun): def time(time): return fun(x) x = 4 return time def boo(x): return x**2 x = 5 result = fun(boo)(10)
from operator import sub def trick(me, you): sub = treat return sub def treat(me, you): return sub(me, 1) treat = trick trick(3, 4)
def easy(x): def peasy(y): def ironic(name): return name(x, y) return y return peasy result = easy(4)(easy)(2)