Tags

,

Guess the output of this code.

by Chad Austin on March 27th, 2006
# Python
names = ['foo', 'bar', 'baz']
fns = [lambda: n for n in names]
print [f() for f in fns]

4 Responses to “Guess the output of this code.”

  1. egometry Says:

    “Syntax error: missing semicolon at line (1)”

  2. thespeedbump Says:

    You fail at Python.

  3. rizen Says:

    I wonder why that is.

  4. sufianrhazi Says:

    how bizarre…

Leave a Reply