You can iterate over the product of all of them. Use itertools.product and go through the ranges.
import itertools for i in itertools.product(range(2), range(3), range(2)): print (i)
gives
(0, 0, 0) (0, 0, 1) (0, 1, 0) (0, 1, 1) (0, 2, 0) (0, 2, 1) (1, 0, 0) (1, 0, 1) (1, 1, 0) (1, 1, 1) (1, 2, 0) (1, 2, 1)
Anteru
source share