0
My output is nothing, anyone here knows why?
I am trying to make a list of possible permutations. Bslow is the code. Somebody help me because it outputs nothing. https://code.sololearn.com/cKkUqvfP4GbH/?ref=app
3 ответов
+ 2
What is the result that you're after?
['ab', 'ac', 'ad', 'ae', ...] ???
if so then
print([''.join(e) for e in y])
This is the same as;
l = []
for e in y:
l.append(''.join(e))
print(l)
+ 1
for elems in y:
x = "".join(elems)
y.append(x)
This creates an infinite loop. You're increasing the length of y with each iteration.
0
ChaoticDawg, what do you suggest? Doing if len(y) == 0 is also doing nothing.