That works perfectly - Thanks! I'm always getting tripped up by the
mutability of lists, I should really learn to look out for it more...
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> I'm having some trouble with a function I've written in Python:
> def myFunction(l1,l2,result=[]):
[snipped rest of function and explanation of what it does]
> Does anyone know what is going on here? Is there an easy solution?
It shined out like a supernova. It has to
[EMAIL PROTECTED] wrote:
> Hi
hi
> I'm having some trouble with a function I've written in Python:
>
> def myFunction(l1,l2,result=[]):
> index=0
> for i in l1:
> result.append([])
> if type(i)==list:
> myFunction(i,l2,result[index])
> else:
>
Hi
I'm having some trouble with a function I've written in Python:
def myFunction(l1,l2,result=[]):
index=0
for i in l1:
result.append([])
if type(i)==list:
myFunction(i,l2,result[index])
else:
for j in l2:
result[index].appe