在Python中,使用itertools这样的东西
from itertools import productfor i in product([0,1], repeat=5): print i
产量:
(0, 0, 0, 0, 0)(0, 0, 0, 0, 1)(0, 0, 0, 1, 0)(0, 0, 0, 1, 1)(0, 0, 1, 0, 0)etc...

在Python中,使用itertools这样的东西
from itertools import productfor i in product([0,1], repeat=5): print i
产量:
(0, 0, 0, 0, 0)(0, 0, 0, 0, 1)(0, 0, 0, 1, 0)(0, 0, 0, 1, 1)(0, 0, 1, 0, 0)etc...