Mar-05-2019, 04:36 PM
(Mar-05-2019, 04:11 PM)ichabod801 Wrote: In terms of recursion, my first thought was to have K be a parameter, defaulting to an empty list, and passing the modified K when you recurse. However, there are problems with using empty lists as parameter defaults. You would have to use None as the default, and then replace it with a list in the body of the function (if it is None).
My question is if I replace K in the function with a list and the list is not empty, how does the ".append" effect the list or should I still use ".append" to change the list? Also, in that way, I need a K outside the function.