On Aug 6, 6:25 am, Neil Cerutti <[EMAIL PROTECTED]> wrote:
Because when the function is called,  the line


>     if y is None: y = []


is executed, binding a brand new empty list to y. This
"rebinding" happens every time the function is called, unless you
provide an argument for y that is not None.

Thanks for the prompt replies. But I am still confused. This is what
confuses me....
The first time you call the function, say with f(23), after the
function ends,
y no longer equals None. Therefore, calling f again, this time like
this f(24),
should make y equal [23,24], because the 'if y == None' test fails, or
at least I think it
fails, because y.append(x) added something that was not equal to None
during the previous call.

Please help me!

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to