When the for loop runs, why does it print all permutations of ABC instead of all 'A's?
def perm(l, n, str_a):
if len(str_a) == n:
print str_a
else:
for c in l:
perm(l, n, str_a+c)
perm("ABC", 3, "")
Prints:
AAA AAB AAC ABA ABB ABC ACA ACB ACC BAA BAB BAC BBA BBB BBC BCA BCB...
