Question: python 3 question: how can you initialize a list to be used recursively(aka to be preserved) without declaring it as a mutable default argument when
python 3 question:
how can you initialize a list to be used recursively(aka to be preserved) without declaring it as a mutable default argument when using recursion:
eg. instead of this:
def my_move(yeah,blah=[])
I want this to work recursively:
def my_move(yeah,blah=None)
if blah is None:
blah=[]
except i want it to keep the list after the first round and not keep replacing it. Thanks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
