待填坑

Posted miaoweiye

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了待填坑相关的知识,希望对你有一定的参考价值。

今天看见一个烧脑的代码,一时没看懂结果,刨个坑,看懂填

def product(*args, repeat=1):
    pools = [tuple(pool) for pool in args] * repeat
    result = [[]]
    for pool in pools:
        result = [x+[y] for x in result for y in pool]
    for prod in result:
        yield tuple(prod)

rtn = product(xyz, 12, repeat=3)
print(list(rtn))


#result:

[(‘x‘, ‘1‘, ‘x‘, ‘1‘, ‘x‘, ‘1‘), (‘x‘, ‘1‘, ‘x‘, ‘1‘, ‘x‘, ‘2‘), (‘x‘, ‘1‘, ‘x‘, ‘1‘, ‘y‘, ‘1‘), (‘x‘, ‘1‘, ‘x‘, ‘1‘, ‘y‘, ‘2‘), (‘x‘, ‘1‘, ‘x‘, ‘1‘, ‘z‘, ‘1‘), (‘x‘, ‘1‘, ‘x‘, ‘1‘, ‘z‘, ‘2‘), (‘x‘, ‘1‘, ‘x‘, ‘2‘, ‘x‘, ‘1‘), (‘x‘, ‘1‘, ‘x‘, ‘2‘, ‘x‘, ‘2‘), (‘x‘, ‘1‘, ‘x‘, ‘2‘, ‘y‘, ‘1‘), (‘x‘, ‘1‘, ‘x‘, ‘2‘, ‘y‘, ‘2‘), (‘x‘, ‘1‘, ‘x‘, ‘2‘, ‘z‘, ‘1‘), (‘x‘, ‘1‘, ‘x‘, ‘2‘, ‘z‘, ‘2‘), (‘x‘, ‘1‘, ‘y‘, ‘1‘, ‘x‘, ‘1‘), (‘x‘, ‘1‘, ‘y‘, ‘1‘, ‘x‘, ‘2‘), (‘x‘, ‘1‘, ‘y‘, ‘1‘, ‘y‘, ‘1‘), (‘x‘, ‘1‘, ‘y‘, ‘1‘, ‘y‘, ‘2‘), (‘x‘, ‘1‘, ‘y‘, ‘1‘, ‘z‘, ‘1‘), (‘x‘, ‘1‘, ‘y‘, ‘1‘, ‘z‘, ‘2‘), (‘x‘, ‘1‘, ‘y‘, ‘2‘, ‘x‘, ‘1‘), (‘x‘, ‘1‘, ‘y‘, ‘2‘, ‘x‘, ‘2‘), (‘x‘, ‘1‘, ‘y‘, ‘2‘, ‘y‘, ‘1‘), (‘x‘, ‘1‘, ‘y‘, ‘2‘, ‘y‘, ‘2‘), (‘x‘, ‘1‘, ‘y‘, ‘2‘, ‘z‘, ‘1‘), (‘x‘, ‘1‘, ‘y‘, ‘2‘, ‘z‘, ‘2‘), (‘x‘, ‘1‘, ‘z‘, ‘1‘, ‘x‘, ‘1‘), (‘x‘, ‘1‘, ‘z‘, ‘1‘, ‘x‘, ‘2‘), (‘x‘, ‘1‘, ‘z‘, ‘1‘, ‘y‘, ‘1‘), (‘x‘, ‘1‘, ‘z‘, ‘1‘, ‘y‘, ‘2‘), (‘x‘, ‘1‘, ‘z‘, ‘1‘, ‘z‘, ‘1‘), (‘x‘, ‘1‘, ‘z‘, ‘1‘, ‘z‘, ‘2‘), (‘x‘, ‘1‘, ‘z‘, ‘2‘, ‘x‘, ‘1‘), (‘x‘, ‘1‘, ‘z‘, ‘2‘, ‘x‘, ‘2‘), (‘x‘, ‘1‘, ‘z‘, ‘2‘, ‘y‘, ‘1‘), (‘x‘, ‘1‘, ‘z‘, ‘2‘, ‘y‘, ‘2‘), (‘x‘, ‘1‘, ‘z‘, ‘2‘, ‘z‘, ‘1‘), (‘x‘, ‘1‘, ‘z‘, ‘2‘, ‘z‘, ‘2‘), (‘x‘, ‘2‘, ‘x‘, ‘1‘, ‘x‘, ‘1‘), (‘x‘, ‘2‘, ‘x‘, ‘1‘, ‘x‘, ‘2‘), (‘x‘, ‘2‘, ‘x‘, ‘1‘, ‘y‘, ‘1‘), (‘x‘, ‘2‘, ‘x‘, ‘1‘, ‘y‘, ‘2‘), (‘x‘, ‘2‘, ‘x‘, ‘1‘, ‘z‘, ‘1‘), (‘x‘, ‘2‘, ‘x‘, ‘1‘, ‘z‘, ‘2‘), (‘x‘, ‘2‘, ‘x‘, ‘2‘, ‘x‘, ‘1‘), (‘x‘, ‘2‘, ‘x‘, ‘2‘, ‘x‘, ‘2‘), (‘x‘, ‘2‘, ‘x‘, ‘2‘, ‘y‘, ‘1‘), (‘x‘, ‘2‘, ‘x‘, ‘2‘, ‘y‘, ‘2‘), (‘x‘, ‘2‘, ‘x‘, ‘2‘, ‘z‘, ‘1‘), (‘x‘, ‘2‘, ‘x‘, ‘2‘, ‘z‘, ‘2‘), (‘x‘, ‘2‘, ‘y‘, ‘1‘, ‘x‘, ‘1‘), (‘x‘, ‘2‘, ‘y‘, ‘1‘, ‘x‘, ‘2‘), (‘x‘, ‘2‘, ‘y‘, ‘1‘, ‘y‘, ‘1‘), (‘x‘, ‘2‘, ‘y‘, ‘1‘, ‘y‘, ‘2‘), (‘x‘, ‘2‘, ‘y‘, ‘1‘, ‘z‘, ‘1‘), (‘x‘, ‘2‘, ‘y‘, ‘1‘, ‘z‘, ‘2‘), (‘x‘, ‘2‘, ‘y‘, ‘2‘, ‘x‘, ‘1‘), (‘x‘, ‘2‘, ‘y‘, ‘2‘, ‘x‘, ‘2‘), (‘x‘, ‘2‘, ‘y‘, ‘2‘, ‘y‘, ‘1‘), (‘x‘, ‘2‘, ‘y‘, ‘2‘, ‘y‘, ‘2‘), (‘x‘, ‘2‘, ‘y‘, ‘2‘, ‘z‘, ‘1‘), (‘x‘, ‘2‘, ‘y‘, ‘2‘, ‘z‘, ‘2‘), (‘x‘, ‘2‘, ‘z‘, ‘1‘, ‘x‘, ‘1‘), (‘x‘, ‘2‘, ‘z‘, ‘1‘, ‘x‘, ‘2‘), (‘x‘, ‘2‘, ‘z‘, ‘1‘, ‘y‘, ‘1‘), (‘x‘, ‘2‘, ‘z‘, ‘1‘, ‘y‘, ‘2‘), (‘x‘, ‘2‘, ‘z‘, ‘1‘, ‘z‘, ‘1‘), (‘x‘, ‘2‘, ‘z‘, ‘1‘, ‘z‘, ‘2‘), (‘x‘, ‘2‘, ‘z‘, ‘2‘, ‘x‘, ‘1‘), (‘x‘, ‘2‘, ‘z‘, ‘2‘, ‘x‘, ‘2‘), (‘x‘, ‘2‘, ‘z‘, ‘2‘, ‘y‘, ‘1‘), (‘x‘, ‘2‘, ‘z‘, ‘2‘, ‘y‘, ‘2‘), (‘x‘, ‘2‘, ‘z‘, ‘2‘, ‘z‘, ‘1‘), (‘x‘, ‘2‘, ‘z‘, ‘2‘, ‘z‘, ‘2‘), (‘y‘, ‘1‘, ‘x‘, ‘1‘, ‘x‘, ‘1‘), (‘y‘, ‘1‘, ‘x‘, ‘1‘, ‘x‘, ‘2‘), (‘y‘, ‘1‘, ‘x‘, ‘1‘, ‘y‘, ‘1‘), (‘y‘, ‘1‘, ‘x‘, ‘1‘, ‘y‘, ‘2‘), (‘y‘, ‘1‘, ‘x‘, ‘1‘, ‘z‘, ‘1‘), (‘y‘, ‘1‘, ‘x‘, ‘1‘, ‘z‘, ‘2‘), (‘y‘, ‘1‘, ‘x‘, ‘2‘, ‘x‘, ‘1‘), (‘y‘, ‘1‘, ‘x‘, ‘2‘, ‘x‘, ‘2‘), (‘y‘, ‘1‘, ‘x‘, ‘2‘, ‘y‘, ‘1‘), (‘y‘, ‘1‘, ‘x‘, ‘2‘, ‘y‘, ‘2‘), (‘y‘, ‘1‘, ‘x‘, ‘2‘, ‘z‘, ‘1‘), (‘y‘, ‘1‘, ‘x‘, ‘2‘, ‘z‘, ‘2‘), (‘y‘, ‘1‘, ‘y‘, ‘1‘, ‘x‘, ‘1‘), (‘y‘, ‘1‘, ‘y‘, ‘1‘, ‘x‘, ‘2‘), (‘y‘, ‘1‘, ‘y‘, ‘1‘, ‘y‘, ‘1‘), (‘y‘, ‘1‘, ‘y‘, ‘1‘, ‘y‘, ‘2‘), (‘y‘, ‘1‘, ‘y‘, ‘1‘, ‘z‘, ‘1‘), (‘y‘, ‘1‘, ‘y‘, ‘1‘, ‘z‘, ‘2‘), (‘y‘, ‘1‘, ‘y‘, ‘2‘, ‘x‘, ‘1‘), (‘y‘, ‘1‘, ‘y‘, ‘2‘, ‘x‘, ‘2‘), (‘y‘, ‘1‘, ‘y‘, ‘2‘, ‘y‘, ‘1‘), (‘y‘, ‘1‘, ‘y‘, ‘2‘, ‘y‘, ‘2‘), (‘y‘, ‘1‘, ‘y‘, ‘2‘, ‘z‘, ‘1‘), (‘y‘, ‘1‘, ‘y‘, ‘2‘, ‘z‘, ‘2‘), (‘y‘, ‘1‘, ‘z‘, ‘1‘, ‘x‘, ‘1‘), (‘y‘, ‘1‘, ‘z‘, ‘1‘, ‘x‘, ‘2‘), (‘y‘, ‘1‘, ‘z‘, ‘1‘, ‘y‘, ‘1‘), (‘y‘, ‘1‘, ‘z‘, ‘1‘, ‘y‘, ‘2‘), (‘y‘, ‘1‘, ‘z‘, ‘1‘, ‘z‘, ‘1‘), (‘y‘, ‘1‘, ‘z‘, ‘1‘, ‘z‘, ‘2‘), (‘y‘, ‘1‘, ‘z‘, ‘2‘, ‘x‘, ‘1‘), (‘y‘, ‘1‘, ‘z‘, ‘2‘, ‘x‘, ‘2‘), (‘y‘, ‘1‘, ‘z‘, ‘2‘, ‘y‘, ‘1‘), (‘y‘, ‘1‘, ‘z‘, ‘2‘, ‘y‘, ‘2‘), (‘y‘, ‘1‘, ‘z‘, ‘2‘, ‘z‘, ‘1‘), (‘y‘, ‘1‘, ‘z‘, ‘2‘, ‘z‘, ‘2‘), (‘y‘, ‘2‘, ‘x‘, ‘1‘, ‘x‘, ‘1‘), (‘y‘, ‘2‘, ‘x‘, ‘1‘, ‘x‘, ‘2‘), (‘y‘, ‘2‘, ‘x‘, ‘1‘, ‘y‘, ‘1‘), (‘y‘, ‘2‘, ‘x‘, ‘1‘, ‘y‘, ‘2‘), (‘y‘, ‘2‘, ‘x‘, ‘1‘, ‘z‘, ‘1‘), (‘y‘, ‘2‘, ‘x‘, ‘1‘, ‘z‘, ‘2‘), (‘y‘, ‘2‘, ‘x‘, ‘2‘, ‘x‘, ‘1‘), (‘y‘, ‘2‘, ‘x‘, ‘2‘, ‘x‘, ‘2‘), (‘y‘, ‘2‘, ‘x‘, ‘2‘, ‘y‘, ‘1‘), (‘y‘, ‘2‘, ‘x‘, ‘2‘, ‘y‘, ‘2‘), (‘y‘, ‘2‘, ‘x‘, ‘2‘, ‘z‘, ‘1‘), (‘y‘, ‘2‘, ‘x‘, ‘2‘, ‘z‘, ‘2‘), (‘y‘, ‘2‘, ‘y‘, ‘1‘, ‘x‘, ‘1‘), (‘y‘, ‘2‘, ‘y‘, ‘1‘, ‘x‘, ‘2‘), (‘y‘, ‘2‘, ‘y‘, ‘1‘, ‘y‘, ‘1‘), (‘y‘, ‘2‘, ‘y‘, ‘1‘, ‘y‘, ‘2‘), (‘y‘, ‘2‘, ‘y‘, ‘1‘, ‘z‘, ‘1‘), (‘y‘, ‘2‘, ‘y‘, ‘1‘, ‘z‘, ‘2‘), (‘y‘, ‘2‘, ‘y‘, ‘2‘, ‘x‘, ‘1‘), (‘y‘, ‘2‘, ‘y‘, ‘2‘, ‘x‘, ‘2‘), (‘y‘, ‘2‘, ‘y‘, ‘2‘, ‘y‘, ‘1‘), (‘y‘, ‘2‘, ‘y‘, ‘2‘, ‘y‘, ‘2‘), (‘y‘, ‘2‘, ‘y‘, ‘2‘, ‘z‘, ‘1‘), (‘y‘, ‘2‘, ‘y‘, ‘2‘, ‘z‘, ‘2‘), (‘y‘, ‘2‘, ‘z‘, ‘1‘, ‘x‘, ‘1‘), (‘y‘, ‘2‘, ‘z‘, ‘1‘, ‘x‘, ‘2‘), (‘y‘, ‘2‘, ‘z‘, ‘1‘, ‘y‘, ‘1‘), (‘y‘, ‘2‘, ‘z‘, ‘1‘, ‘y‘, ‘2‘), (‘y‘, ‘2‘, ‘z‘, ‘1‘, ‘z‘, ‘1‘), (‘y‘, ‘2‘, ‘z‘, ‘1‘, ‘z‘, ‘2‘), (‘y‘, ‘2‘, ‘z‘, ‘2‘, ‘x‘, ‘1‘), (‘y‘, ‘2‘, ‘z‘, ‘2‘, ‘x‘, ‘2‘), (‘y‘, ‘2‘, ‘z‘, ‘2‘, ‘y‘, ‘1‘), (‘y‘, ‘2‘, ‘z‘, ‘2‘, ‘y‘, ‘2‘), (‘y‘, ‘2‘, ‘z‘, ‘2‘, ‘z‘, ‘1‘), (‘y‘, ‘2‘, ‘z‘, ‘2‘, ‘z‘, ‘2‘), (‘z‘, ‘1‘, ‘x‘, ‘1‘, ‘x‘, ‘1‘), (‘z‘, ‘1‘, ‘x‘, ‘1‘, ‘x‘, ‘2‘), (‘z‘, ‘1‘, ‘x‘, ‘1‘, ‘y‘, ‘1‘), (‘z‘, ‘1‘, ‘x‘, ‘1‘, ‘y‘, ‘2‘), (‘z‘, ‘1‘, ‘x‘, ‘1‘, ‘z‘, ‘1‘), (‘z‘, ‘1‘, ‘x‘, ‘1‘, ‘z‘, ‘2‘), (‘z‘, ‘1‘, ‘x‘, ‘2‘, ‘x‘, ‘1‘), (‘z‘, ‘1‘, ‘x‘, ‘2‘, ‘x‘, ‘2‘), (‘z‘, ‘1‘, ‘x‘, ‘2‘, ‘y‘, ‘1‘), (‘z‘, ‘1‘, ‘x‘, ‘2‘, ‘y‘, ‘2‘), (‘z‘, ‘1‘, ‘x‘, ‘2‘, ‘z‘, ‘1‘), (‘z‘, ‘1‘, ‘x‘, ‘2‘, ‘z‘, ‘2‘), (‘z‘, ‘1‘, ‘y‘, ‘1‘, ‘x‘, ‘1‘), (‘z‘, ‘1‘, ‘y‘, ‘1‘, ‘x‘, ‘2‘), (‘z‘, ‘1‘, ‘y‘, ‘1‘, ‘y‘, ‘1‘), (‘z‘, ‘1‘, ‘y‘, ‘1‘, ‘y‘, ‘2‘), (‘z‘, ‘1‘, ‘y‘, ‘1‘, ‘z‘, ‘1‘), (‘z‘, ‘1‘, ‘y‘, ‘1‘, ‘z‘, ‘2‘), (‘z‘, ‘1‘, ‘y‘, ‘2‘, ‘x‘, ‘1‘), (‘z‘, ‘1‘, ‘y‘, ‘2‘, ‘x‘, ‘2‘), (‘z‘, ‘1‘, ‘y‘, ‘2‘, ‘y‘, ‘1‘), (‘z‘, ‘1‘, ‘y‘, ‘2‘, ‘y‘, ‘2‘), (‘z‘, ‘1‘, ‘y‘, ‘2‘, ‘z‘, ‘1‘), (‘z‘, ‘1‘, ‘y‘, ‘2‘, ‘z‘, ‘2‘), (‘z‘, ‘1‘, ‘z‘, ‘1‘, ‘x‘, ‘1‘), (‘z‘, ‘1‘, ‘z‘, ‘1‘, ‘x‘, ‘2‘), (‘z‘, ‘1‘, ‘z‘, ‘1‘, ‘y‘, ‘1‘), (‘z‘, ‘1‘, ‘z‘, ‘1‘, ‘y‘, ‘2‘), (‘z‘, ‘1‘, ‘z‘, ‘1‘, ‘z‘, ‘1‘), (‘z‘, ‘1‘, ‘z‘, ‘1‘, ‘z‘, ‘2‘), (‘z‘, ‘1‘, ‘z‘, ‘2‘, ‘x‘, ‘1‘), (‘z‘, ‘1‘, ‘z‘, ‘2‘, ‘x‘, ‘2‘), (‘z‘, ‘1‘, ‘z‘, ‘2‘, ‘y‘, ‘1‘), (‘z‘, ‘1‘, ‘z‘, ‘2‘, ‘y‘, ‘2‘), (‘z‘, ‘1‘, ‘z‘, ‘2‘, ‘z‘, ‘1‘), (‘z‘, ‘1‘, ‘z‘, ‘2‘, ‘z‘, ‘2‘), (‘z‘, ‘2‘, ‘x‘, ‘1‘, ‘x‘, ‘1‘), (‘z‘, ‘2‘, ‘x‘, ‘1‘, ‘x‘, ‘2‘), (‘z‘, ‘2‘, ‘x‘, ‘1‘, ‘y‘, ‘1‘), (‘z‘, ‘2‘, ‘x‘, ‘1‘, ‘y‘, ‘2‘), (‘z‘, ‘2‘, ‘x‘, ‘1‘, ‘z‘, ‘1‘), (‘z‘, ‘2‘, ‘x‘, ‘1‘, ‘z‘, ‘2‘), (‘z‘, ‘2‘, ‘x‘, ‘2‘, ‘x‘, ‘1‘), (‘z‘, ‘2‘, ‘x‘, ‘2‘, ‘x‘, ‘2‘), (‘z‘, ‘2‘, ‘x‘, ‘2‘, ‘y‘, ‘1‘), (‘z‘, ‘2‘, ‘x‘, ‘2‘, ‘y‘, ‘2‘), (‘z‘, ‘2‘, ‘x‘, ‘2‘, ‘z‘, ‘1‘), (‘z‘, ‘2‘, ‘x‘, ‘2‘, ‘z‘, ‘2‘), (‘z‘, ‘2‘, ‘y‘, ‘1‘, ‘x‘, ‘1‘), (‘z‘, ‘2‘, ‘y‘, ‘1‘, ‘x‘, ‘2‘), (‘z‘, ‘2‘, ‘y‘, ‘1‘, ‘y‘, ‘1‘), (‘z‘, ‘2‘, ‘y‘, ‘1‘, ‘y‘, ‘2‘), (‘z‘, ‘2‘, ‘y‘, ‘1‘, ‘z‘, ‘1‘), (‘z‘, ‘2‘, ‘y‘, ‘1‘, ‘z‘, ‘2‘), (‘z‘, ‘2‘, ‘y‘, ‘2‘, ‘x‘, ‘1‘), (‘z‘, ‘2‘, ‘y‘, ‘2‘, ‘x‘, ‘2‘), (‘z‘, ‘2‘, ‘y‘, ‘2‘, ‘y‘, ‘1‘), (‘z‘, ‘2‘, ‘y‘, ‘2‘, ‘y‘, ‘2‘), (‘z‘, ‘2‘, ‘y‘, ‘2‘, ‘z‘, ‘1‘), (‘z‘, ‘2‘, ‘y‘, ‘2‘, ‘z‘, ‘2‘), (‘z‘, ‘2‘, ‘z‘, ‘1‘, ‘x‘, ‘1‘), (‘z‘, ‘2‘, ‘z‘, ‘1‘, ‘x‘, ‘2‘), (‘z‘, ‘2‘, ‘z‘, ‘1‘, ‘y‘, ‘1‘), (‘z‘, ‘2‘, ‘z‘, ‘1‘, ‘y‘, ‘2‘), (‘z‘, ‘2‘, ‘z‘, ‘1‘, ‘z‘, ‘1‘), (‘z‘, ‘2‘, ‘z‘, ‘1‘, ‘z‘, ‘2‘), (‘z‘, ‘2‘, ‘z‘, ‘2‘, ‘x‘, ‘1‘), (‘z‘, ‘2‘, ‘z‘, ‘2‘, ‘x‘, ‘2‘), (‘z‘, ‘2‘, ‘z‘, ‘2‘, ‘y‘, ‘1‘), (‘z‘, ‘2‘, ‘z‘, ‘2‘, ‘y‘, ‘2‘), (‘z‘, ‘2‘, ‘z‘, ‘2‘, ‘z‘, ‘1‘), (‘z‘, ‘2‘, ‘z‘, ‘2‘, ‘z‘, ‘2‘)]

 

 

##############################################################33

pools=[(‘x‘, ‘y‘, ‘z‘), (‘1‘, ‘2‘), (‘x‘, ‘y‘, ‘z‘), (‘1‘, ‘2‘), (‘x‘, ‘y‘, ‘z‘), (‘1‘, ‘2‘)]
result=

[[‘x‘, ‘1‘, ‘x‘, ‘1‘, ‘x‘, ‘1‘], [‘x‘, ‘1‘, ‘x‘, ‘1‘, ‘x‘, ‘2‘], [‘x‘, ‘1‘, ‘x‘, ‘1‘, ‘y‘, ‘1‘], [‘x‘, ‘1‘, ‘x‘, ‘1‘, ‘y‘, ‘2‘], [‘x‘, ‘1‘, ‘x‘, ‘1‘, ‘z‘, ‘1‘], [‘x‘, ‘1‘, ‘x‘, ‘1‘, ‘z‘, ‘2‘], [‘x‘, ‘1‘, ‘x‘, ‘2‘, ‘x‘, ‘1‘], [‘x‘, ‘1‘, ‘x‘, ‘2‘, ‘x‘, ‘2‘], [‘x‘, ‘1‘, ‘x‘, ‘2‘, ‘y‘, ‘1‘], [‘x‘, ‘1‘, ‘x‘, ‘2‘, ‘y‘, ‘2‘], [‘x‘, ‘1‘, ‘x‘, ‘2‘, ‘z‘, ‘1‘], [‘x‘, ‘1‘, ‘x‘, ‘2‘, ‘z‘, ‘2‘], [‘x‘, ‘1‘, ‘y‘, ‘1‘, ‘x‘, ‘1‘], [‘x‘, ‘1‘, ‘y‘, ‘1‘, ‘x‘, ‘2‘], [‘x‘, ‘1‘, ‘y‘, ‘1‘, ‘y‘, ‘1‘], [‘x‘, ‘1‘, ‘y‘, ‘1‘, ‘y‘, ‘2‘], [‘x‘, ‘1‘, ‘y‘, ‘1‘, ‘z‘, ‘1‘], [‘x‘, ‘1‘, ‘y‘, ‘1‘, ‘z‘, ‘2‘], [‘x‘, ‘1‘, ‘y‘, ‘2‘, ‘x‘, ‘1‘], [‘x‘, ‘1‘, ‘y‘, ‘2‘, ‘x‘, ‘2‘], [‘x‘, ‘1‘, ‘y‘, ‘2‘, ‘y‘, ‘1‘], [‘x‘, ‘1‘, ‘y‘, ‘2‘, ‘y‘, ‘2‘], [‘x‘, ‘1‘, ‘y‘, ‘2‘, ‘z‘, ‘1‘], [‘x‘, ‘1‘, ‘y‘, ‘2‘, ‘z‘, ‘2‘], [‘x‘, ‘1‘, ‘z‘, ‘1‘, ‘x‘, ‘1‘], [‘x‘, ‘1‘, ‘z‘, ‘1‘, ‘x‘, ‘2‘], [‘x‘, ‘1‘, ‘z‘, ‘1‘, ‘y‘, ‘1‘], [‘x‘, ‘1‘, ‘z‘, ‘1‘, ‘y‘, ‘2‘], [‘x‘, ‘1‘, ‘z‘, ‘1‘, ‘z‘, ‘1‘], [‘x‘, ‘1‘, ‘z‘, ‘1‘, ‘z‘, ‘2‘], [‘x‘, ‘1‘, ‘z‘, ‘2‘, ‘x‘, ‘1‘], [‘x‘, ‘1‘, ‘z‘, ‘2‘, ‘x‘, ‘2‘], [‘x‘, ‘1‘, ‘z‘, ‘2‘, ‘y‘, ‘1‘], [‘x‘, ‘1‘, ‘z‘, ‘2‘, ‘y‘, ‘2‘], [‘x‘, ‘1‘, ‘z‘, ‘2‘, ‘z‘, ‘1‘], [‘x‘, ‘1‘, ‘z‘, ‘2‘, ‘z‘, ‘2‘], [‘x‘, ‘2‘, ‘x‘, ‘1‘, ‘x‘, ‘1‘], [‘x‘, ‘2‘, ‘x‘, ‘1‘, ‘x‘, ‘2‘], [‘x‘, ‘2‘, ‘x‘, ‘1‘, ‘y‘, ‘1‘], [‘x‘, ‘2‘, ‘x‘, ‘1‘, ‘y‘, ‘2‘], [‘x‘, ‘2‘, ‘x‘, ‘1‘, ‘z‘, ‘1‘], [‘x‘, ‘2‘, ‘x‘, ‘1‘, ‘z‘, ‘2‘], [‘x‘, ‘2‘, ‘x‘, ‘2‘, ‘x‘, ‘1‘], [‘x‘, ‘2‘, ‘x‘, ‘2‘, ‘x‘, ‘2‘], [‘x‘, ‘2‘, ‘x‘, ‘2‘, ‘y‘, ‘1‘], [‘x‘, ‘2‘, ‘x‘, ‘2‘, ‘y‘, ‘2‘], [‘x‘, ‘2‘, ‘x‘, ‘2‘, ‘z‘, ‘1‘], [‘x‘, ‘2‘, ‘x‘, ‘2‘, ‘z‘, ‘2‘], [‘x‘, ‘2‘, ‘y‘, ‘1‘, ‘x‘, ‘1‘], [‘x‘, ‘2‘, ‘y‘, ‘1‘, ‘x‘, ‘2‘], [‘x‘, ‘2‘, ‘y‘, ‘1‘, ‘y‘, ‘1‘], [‘x‘, ‘2‘, ‘y‘, ‘1‘, ‘y‘, ‘2‘], [‘x‘, ‘2‘, ‘y‘, ‘1‘, ‘z‘, ‘1‘], [‘x‘, ‘2‘, ‘y‘, ‘1‘, ‘z‘, ‘2‘], [‘x‘, ‘2‘, ‘y‘, ‘2‘, ‘x‘, ‘1‘], [‘x‘, ‘2‘, ‘y‘, ‘2‘, ‘x‘, ‘2‘], [‘x‘, ‘2‘, ‘y‘, ‘2‘, ‘y‘, ‘1‘], [‘x‘, ‘2‘, ‘y‘, ‘2‘, ‘y‘, ‘2‘], [‘x‘, ‘2‘, ‘y‘, ‘2‘, ‘z‘, ‘1‘], [‘x‘, ‘2‘, ‘y‘, ‘2‘, ‘z‘, ‘2‘], [‘x‘, ‘2‘, ‘z‘, ‘1‘, ‘x‘, ‘1‘], [‘x‘, ‘2‘, ‘z‘, ‘1‘, ‘x‘, ‘2‘], [‘x‘, ‘2‘, ‘z‘, ‘1‘, ‘y‘, ‘1‘], [‘x‘, ‘2‘, ‘z‘, ‘1‘, ‘y‘, ‘2‘], [‘x‘, ‘2‘, ‘z‘, ‘1‘, ‘z‘, ‘1‘], [‘x‘, ‘2‘, ‘z‘, ‘1‘, ‘z‘, ‘2‘], [‘x‘, ‘2‘, ‘z‘, ‘2‘, ‘x‘, ‘1‘], [‘x‘, ‘2‘, ‘z‘, ‘2‘, ‘x‘, ‘2‘], [‘x‘, ‘2‘, ‘z‘, ‘2‘, ‘y‘, ‘1‘], [‘x‘, ‘2‘, ‘z‘, ‘2‘, ‘y‘, ‘2‘], [‘x‘, ‘2‘, ‘z‘, ‘2‘, ‘z‘, ‘1‘], [‘x‘, ‘2‘, ‘z‘, ‘2‘, ‘z‘, ‘2‘], [‘y‘, ‘1‘, ‘x‘, ‘1‘, ‘x‘, ‘1‘], [‘y‘, ‘1‘, ‘x‘, ‘1‘, ‘x‘, ‘2‘], [‘y‘, ‘1‘, ‘x‘, ‘1‘, ‘y‘, ‘1‘], [‘y‘, ‘1‘, ‘x‘, ‘1‘, ‘y‘, ‘2‘], [‘y‘, ‘1‘, ‘x‘, ‘1‘, ‘z‘, ‘1‘], [‘y‘, ‘1‘, ‘x‘, ‘1‘, ‘z‘, ‘2‘], [‘y‘, ‘1‘, ‘x‘, ‘2‘, ‘x‘, ‘1‘], [‘y‘, ‘1‘, ‘x‘, ‘2‘, ‘x‘, ‘2‘], [‘y‘, ‘1‘, ‘x‘, ‘2‘, ‘y‘, ‘1‘], [‘y‘, ‘1‘, ‘x‘, ‘2‘, ‘y‘, ‘2‘], [‘y‘, ‘1‘, ‘x‘, ‘2‘, ‘z‘, ‘1‘], [‘y‘, ‘1‘, ‘x‘, ‘2‘, ‘z‘, ‘2‘], [‘y‘, ‘1‘, ‘y‘, ‘1‘, ‘x‘, ‘1‘], [‘y‘, ‘1‘, ‘y‘, ‘1‘, ‘x‘, ‘2‘], [‘y‘, ‘1‘, ‘y‘, ‘1‘, ‘y‘, ‘1‘], [‘y‘, ‘1‘, ‘y‘, ‘1‘, ‘y‘, ‘2‘], [‘y‘, ‘1‘, ‘y‘, ‘1‘, ‘z‘, ‘1‘], [‘y‘, ‘1‘, ‘y‘, ‘1‘, ‘z‘, ‘2‘], [‘y‘, ‘1‘, ‘y‘, ‘2‘, ‘x‘, ‘1‘], [‘y‘, ‘1‘, ‘y‘, ‘2‘, ‘x‘, ‘2‘], [‘y‘, ‘1‘, ‘y‘, ‘2‘, ‘y‘, ‘1‘], [‘y‘, ‘1‘, ‘y‘, ‘2‘, ‘y‘, ‘2‘], [‘y‘, ‘1‘, ‘y‘, ‘2‘, ‘z‘, ‘1‘], [‘y‘, ‘1‘, ‘y‘, ‘2‘, ‘z‘, ‘2‘], [‘y‘, ‘1‘, ‘z‘, ‘1‘, ‘x‘, ‘1‘], [‘y‘, ‘1‘, ‘z‘, ‘1‘, ‘x‘, ‘2‘], [‘y‘, ‘1‘, ‘z‘, ‘1‘, ‘y‘, ‘1‘], [‘y‘, ‘1‘, ‘z‘, ‘1‘, ‘y‘, ‘2‘], [‘y‘, ‘1‘, ‘z‘, ‘1‘, ‘z‘, ‘1‘], [‘y‘, ‘1‘, ‘z‘, ‘1‘, ‘z‘, ‘2‘], [‘y‘, ‘1‘, ‘z‘, ‘2‘, ‘x‘, ‘1‘], [‘y‘, ‘1‘, ‘z‘, ‘2‘, ‘x‘, ‘2‘], [‘y‘, ‘1‘, ‘z‘, ‘2‘, ‘y‘, ‘1‘], [‘y‘, ‘1‘, ‘z‘, ‘2‘, ‘y‘, ‘2‘], [‘y‘, ‘1‘, ‘z‘, ‘2‘, ‘z‘, ‘1‘], [‘y‘, ‘1‘, ‘z‘, ‘2‘, ‘z‘, ‘2‘], [‘y‘, ‘2‘, ‘x‘, ‘1‘, ‘x‘, ‘1‘], [‘y‘, ‘2‘, ‘x‘, ‘1‘, ‘x‘, ‘2‘], [‘y‘, ‘2‘, ‘x‘, ‘1‘, ‘y‘, ‘1‘], [‘y‘, ‘2‘, ‘x‘, ‘1‘, ‘y‘, ‘2‘], [‘y‘, ‘2‘, ‘x‘, ‘1‘, ‘z‘, ‘1‘], [‘y‘, ‘2‘, ‘x‘, ‘1‘, ‘z‘, ‘2‘], [‘y‘, ‘2‘, ‘x‘, ‘2‘, ‘x‘, ‘1‘], [‘y‘, ‘2‘, ‘x‘, ‘2‘, ‘x‘, ‘2‘], [‘y‘, ‘2‘, ‘x‘, ‘2‘, ‘y‘, ‘1‘], [‘y‘, ‘2‘, ‘x‘, ‘2‘, ‘y‘, ‘2‘], [‘y‘, ‘2‘, ‘x‘, ‘2‘, ‘z‘, ‘1‘], [‘y‘, ‘2‘, ‘x‘, ‘2‘, ‘z‘, ‘2‘], [‘y‘, ‘2‘, ‘y‘, ‘1‘, ‘x‘, ‘1‘], [‘y‘, ‘2‘, ‘y‘, ‘1‘, ‘x‘, ‘2‘], [‘y‘, ‘2‘, ‘y‘, ‘1‘, ‘y‘, ‘1‘], [‘y‘, ‘2‘, ‘y‘, ‘1‘, ‘y‘, ‘2‘], [‘y‘, ‘2‘, ‘y‘, ‘1‘, ‘z‘, ‘1‘], [‘y‘, ‘2‘, ‘y‘, ‘1‘, ‘z‘, ‘2‘], [‘y‘, ‘2‘, ‘y‘, ‘2‘, ‘x‘, ‘1‘], [‘y‘, ‘2‘, ‘y‘, ‘2‘, ‘x‘, ‘2‘], [‘y‘, ‘2‘, ‘y‘, ‘2‘, ‘y‘, ‘1‘], [‘y‘, ‘2‘, ‘y‘, ‘2‘, ‘y‘, ‘2‘], [‘y‘, ‘2‘, ‘y‘, ‘2‘, ‘z‘, ‘1‘], [‘y‘, ‘2‘, ‘y‘, ‘2‘, ‘z‘, ‘2‘], [‘y‘, ‘2‘, ‘z‘, ‘1‘, ‘x‘, ‘1‘], [‘y‘, ‘2‘, ‘z‘, ‘1‘, ‘x‘, ‘2‘], [‘y‘, ‘2‘, ‘z‘, ‘1‘, ‘y‘, ‘1‘], [‘y‘, ‘2‘, ‘z‘, ‘1‘, ‘y‘, ‘2‘], [‘y‘, ‘2‘, ‘z‘, ‘1‘, ‘z‘, ‘1‘], [‘y‘, ‘2‘, ‘z‘, ‘1‘, ‘z‘, ‘2‘], [‘y‘, ‘2‘, ‘z‘, ‘2‘, ‘x‘, ‘1‘], [‘y‘, ‘2‘, ‘z‘, ‘2‘, ‘x‘, ‘2‘], [‘y‘, ‘2‘, ‘z‘, ‘2‘, ‘y‘, ‘1‘], [‘y‘, ‘2‘, ‘z‘, ‘2‘, ‘y‘, ‘2‘], [‘y‘, ‘2‘, ‘z‘, ‘2‘, ‘z‘, ‘1‘], [‘y‘, ‘2‘, ‘z‘, ‘2‘, ‘z‘, ‘2‘], [‘z‘, ‘1‘, ‘x‘, ‘1‘, ‘x‘, ‘1‘], [‘z‘, ‘1‘, ‘x‘, ‘1‘, ‘x‘, ‘2‘], [‘z‘, ‘1‘, ‘x‘, ‘1‘, ‘y‘, ‘1‘], [‘z‘, ‘1‘, ‘x‘, ‘1‘, ‘y‘, ‘2‘], [‘z‘, ‘1‘, ‘x‘, ‘1‘, ‘z‘, ‘1‘], [‘z‘, ‘1‘, ‘x‘, ‘1‘, ‘z‘, ‘2‘], [‘z‘, ‘1‘, ‘x‘, ‘2‘, ‘x‘, ‘1‘], [‘z‘, ‘1‘, ‘x‘, ‘2‘, ‘x‘, ‘2‘], [‘z‘, ‘1‘, ‘x‘, ‘2‘, ‘y‘, ‘1‘], [‘z‘, ‘1‘, ‘x‘, ‘2‘, ‘y‘, ‘2‘], [‘z‘, ‘1‘, ‘x‘, ‘2‘, ‘z‘, ‘1‘], [‘z‘, ‘1‘, ‘x‘, ‘2‘, ‘z‘, ‘2‘], [‘z‘, ‘1‘, ‘y‘, ‘1‘, ‘x‘, ‘1‘], [‘z‘, ‘1‘, ‘y‘, ‘1‘, ‘x‘, ‘2‘], [‘z‘, ‘1‘, ‘y‘, ‘1‘, ‘y‘, ‘1‘], [‘z‘, ‘1‘, ‘y‘, ‘1‘, ‘y‘, ‘2‘], [‘z‘, ‘1‘, ‘y‘, ‘1‘, ‘z‘, ‘1‘], [‘z‘, ‘1‘, ‘y‘, ‘1‘, ‘z‘, ‘2‘], [‘z‘, ‘1‘, ‘y‘, ‘2‘, ‘x‘, ‘1‘], [‘z‘, ‘1‘, ‘y‘, ‘2‘, ‘x‘, ‘2‘], [‘z‘, ‘1‘, ‘y‘, ‘2‘, ‘y‘, ‘1‘], [‘z‘, ‘1‘, ‘y‘, ‘2‘, ‘y‘, ‘2‘], [‘z‘, ‘1‘, ‘y‘, ‘2‘, ‘z‘, ‘1‘], [‘z‘, ‘1‘, ‘y‘, ‘2‘, ‘z‘, ‘2‘], [‘z‘, ‘1‘, ‘z‘, ‘1‘, ‘x‘, ‘1‘], [‘z‘, ‘1‘, ‘z‘, ‘1‘, ‘x‘, ‘2‘], [‘z‘, ‘1‘, ‘z‘, ‘1‘, ‘y‘, ‘1‘], [‘z‘, ‘1‘, ‘z‘, ‘1‘, ‘y‘, ‘2‘], [‘z‘, ‘1‘, ‘z‘, ‘1‘, ‘z‘, ‘1‘], [‘z‘, ‘1‘, ‘z‘, ‘1‘, ‘z‘, ‘2‘], [‘z‘, ‘1‘, ‘z‘, ‘2‘, ‘x‘, ‘1‘], [‘z‘, ‘1‘, ‘z‘, ‘2‘, ‘x‘, ‘2‘], [‘z‘, ‘1‘, ‘z‘, ‘2‘, ‘y‘, ‘1‘], [‘z‘, ‘1‘, ‘z‘, ‘2‘, ‘y‘, ‘2‘], [‘z‘, ‘1‘, ‘z‘, ‘2‘, ‘z‘, ‘1‘], [‘z‘, ‘1‘, ‘z‘, ‘2‘, ‘z‘, ‘2‘], [‘z‘, ‘2‘, ‘x‘, ‘1‘, ‘x‘, ‘1‘], [‘z‘, ‘2‘, ‘x‘, ‘1‘, ‘x‘, ‘2‘], [‘z‘, ‘2‘, ‘x‘, ‘1‘, ‘y‘, ‘1‘], [‘z‘, ‘2‘, ‘x‘, ‘1‘, ‘y‘, ‘2‘], [‘z‘, ‘2‘, ‘x‘, ‘1‘, ‘z‘, ‘1‘], [‘z‘, ‘2‘, ‘x‘, ‘1‘, ‘z‘, ‘2‘], [‘z‘, ‘2‘, ‘x‘, ‘2‘, ‘x‘, ‘1‘], [‘z‘, ‘2‘, ‘x‘, ‘2‘, ‘x‘, ‘2‘], [‘z‘, ‘2‘, ‘x‘, ‘2‘, ‘y‘, ‘1‘], [‘z‘, ‘2‘, ‘x‘, ‘2‘, ‘y‘, ‘2‘], [‘z‘, ‘2‘, ‘x‘, ‘2‘, ‘z‘, ‘1‘], [‘z‘, ‘2‘, ‘x‘, ‘2‘, ‘z‘, ‘2‘], [‘z‘, ‘2‘, ‘y‘, ‘1‘, ‘x‘, ‘1‘], [‘z‘, ‘2‘, ‘y‘, ‘1‘, ‘x‘, ‘2‘], [‘z‘, ‘2‘, ‘y‘, ‘1‘, ‘y‘, ‘1‘], [‘z‘, ‘2‘, ‘y‘, ‘1‘, ‘y‘, ‘2‘], [‘z‘, ‘2‘, ‘y‘, ‘1‘, ‘z‘, ‘1‘], [‘z‘, ‘2‘, ‘y‘, ‘1‘, ‘z‘, ‘2‘], [‘z‘, ‘2‘, ‘y‘, ‘2‘, ‘x‘, ‘1‘], [‘z‘, ‘2‘, ‘y‘, ‘2‘, ‘x‘, ‘2‘], [‘z‘, ‘2‘, ‘y‘, ‘2‘, ‘y‘, ‘1‘], [‘z‘, ‘2‘, ‘y‘, ‘2‘, ‘y‘, ‘2‘], [‘z‘, ‘2‘, ‘y‘, ‘2‘, ‘z‘, ‘1‘], [‘z‘, ‘2‘, ‘y‘, ‘2‘, ‘z‘, ‘2‘], [‘z‘, ‘2‘, ‘z‘, ‘1‘, ‘x‘, ‘1‘], [‘z‘, ‘2‘, ‘z‘, ‘1‘, ‘x‘, ‘2‘], [‘z‘, ‘2‘, ‘z‘, ‘1‘, ‘y‘, ‘1‘], [‘z‘, ‘2‘, ‘z‘, ‘1‘, ‘y‘, ‘2‘], [‘z‘, ‘2‘, ‘z‘, ‘1‘, ‘z‘, ‘1‘], [‘z‘, ‘2‘, ‘z‘, ‘1‘, ‘z‘, ‘2‘], [‘z‘, ‘2‘, ‘z‘, ‘2‘, ‘x‘, ‘1‘], [‘z‘, ‘2‘, ‘z‘, ‘2‘, ‘x‘, ‘2‘], [‘z‘, ‘2‘, ‘z‘, ‘2‘, ‘y‘, ‘1‘], [‘z‘, ‘2‘, ‘z‘, ‘2‘, ‘y‘, ‘2‘], [‘z‘, ‘2‘, ‘z‘, ‘2‘, ‘z‘, ‘1‘], [‘z‘, ‘2‘, ‘z‘, ‘2‘, ‘z‘, ‘2‘]]

 

通过打印两个关键列表,看懂了,pools是把两个字符串分割成两个元组重复了三遍,result为列表推导式,先执行后面的for循环,等于是把result中的6个元组里的元素分别组合了一遍成为一个个列表,整体是个二维列表,最后的for循环yield把二维列表中的一个个列表变为元组

 

 


 

以上是关于待填坑的主要内容,如果未能解决你的问题,请参考以下文章

待填坑

BestCoder Round #80 待填坑

pythonpython魔法方法(待填坑)

爬虫beautiful soup笔记(待填坑)

MCMC蒙特卡罗方法

支持向量机原理线性不可分支持向量机与核函数