On 12/09/2014 at 14:26, xxxxxxxx wrote:
Hello everybody,
I wrote the following lines and Im not able to understand what happens.
import c4d
#Welcome to the world of Python
def A(lst=[]) :
lst.append("A")
return lst
def main() :
print A()
If I execute the code first time the variable lst is printed in console exactly how I expect.
>>>['A']
If I execute second time...
>>>['A']['A']
third time...
>>>['A']['A']['A']
and so on.
>>>['A']['A']['A']['A']
\>>>['A']['A']['A']['A']['A']
\>>>['A']['A']['A']['A']['A']['A']
\>>>['A']['A']['A']['A']['A']['A']['A']
How can I stop that behaviour? 'del lst' didnt work.
THX and Greeting
rown