Jun-02-2019, 09:03 PM
I don't understand what the objective is, so no help here. However, I would like to remind what will happen if there is parameter level = []:
>>> def example(level=[]): ... level.append(1) ... return level ... >>> example() [1] >>> example() [1, 1] >>> example() [1, 1, 1] >>> def example_2(num, level=[]): ... level.append(num) ... return level ... >>> example_2(1) [1] >>> example_2(2) [1, 2] >>> example_2('3') [1, 2, '3'] >>> def example_3(num, level=[]): ... level.append(num) ... return [num * num for num in level] ... >>> example_3(1) [1] >>> example_3(2) [1, 4]
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.