A Fresh Cell Per Call Is Not the Loop Bug
def setup():
def make_func(i):
return lambda: i * 10
return [make_func(i) for i in range(3)]
funcs = setup()
print([f() for f in funcs])
What does this print, and why?
Sign in to answer questions and track your progress
Sign In