该变量返回“[ ]”而不是所需的结果。
S = set(['a', 'b','d','z','x','y'])
collect = set()
step = set([''])
while step:
step = set(a+b for a in step for b in S if len(a+b) == 6)
collect |= step
print sorted(collect)
另外,我怎样才能使这个循环通过组合而不是一组来播放?
该变量返回“[ ]”而不是所需的结果。
S = set(['a', 'b','d','z','x','y'])
collect = set()
step = set([''])
while step:
step = set(a+b for a in step for b in S if len(a+b) == 6)
collect |= step
print sorted(collect)
另外,我怎样才能使这个循环通过组合而不是一组来播放?