On Mar 16, 3:59 pm, "7stud" <[EMAIL PROTECTED]> wrote:
> lst = [a, b]
>
> The () symbol causes the named function to execute, and a function
> call in the code is always replaced by the function's return value.
Try this:
------
def a():
print "this is a"
def b():
print "this is b"
lst = [a(), b()]
------
To create the list, the terms inside the list have to be evaluated.
That causes a and b to execute, and the function calls are replaced by
the each function's return value. Since your functions don't have a
return statement, the value None is returned. To see that, add this
line:
print lst
--
http://mail.python.org/mailman/listinfo/python-list