Danke! < /P>
Code: Select all
A=[1,2,3]
c=[]
def perm(a):
global c
if len(a)==1:
p=a
else:
for i in a:
p=[i]+perm(a.remove(i))
c+=[p]
return p
perm(A)
print(c)
TypeError: object of type 'NoneType' has no len()
Code: Select all
A=[1,2,3]
c=[]
def perm(a):
global c
if len(a)==1:
p=a
else:
for i in a:
p=[i]+perm(a.remove(i))
c+=[p]
return p
perm(A)
print(c)
TypeError: object of type 'NoneType' has no len()