Home

On Aug 6, 6:25 am, Neil Cerutti <horp...@yahoo.com> 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!

previous
next

Re: How bool data type is implemented in C++
Re: MySQLdb: ValueError Something Stupid
Removing tags with BeautifulSoup
Re: how to join array of integers?
is there a posh Win32 binary? or, compiling with MS 2005 Express...
Dzieci Niczyje
Podaruj Zycie
Mam Marzenie
Akogo
Fundacja Sloneczko