lambda semantics in for loop
Tomek Meka
tmeka at gmx.net
Sun Jan 5 08:56:28 EST 2003
More information about the Python-list mailing list
Sun Jan 5 08:56:28 EST 2003
- Previous message (by thread): lambda semantics in for loop
- Next message (by thread): lambda semantics in for loop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi!
You could also write:
def f(i):
def g(x):
return i + x
return g
and then:
l = []
for i in range(10):
l.append(f(i))
Regards,
Tomek
- Previous message (by thread): lambda semantics in for loop
- Next message (by thread): lambda semantics in for loop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list