fork download
  1. import itertools
  2.  
  3. # you can read from file.
  4. var_list = [
  5. [1, 2, 3],
  6. [1.1, 2.2, 3.3],
  7. ['a', 'b']
  8. ]
  9.  
  10. for var_tuple in itertools.product(*var_list):
  11. print var_tuple
Success #stdin #stdout 0.01s 7456KB
stdin
Standard input is empty
stdout
(1, 1.1, 'a')
(1, 1.1, 'b')
(1, 2.2, 'a')
(1, 2.2, 'b')
(1, 3.3, 'a')
(1, 3.3, 'b')
(2, 1.1, 'a')
(2, 1.1, 'b')
(2, 2.2, 'a')
(2, 2.2, 'b')
(2, 3.3, 'a')
(2, 3.3, 'b')
(3, 1.1, 'a')
(3, 1.1, 'b')
(3, 2.2, 'a')
(3, 2.2, 'b')
(3, 3.3, 'a')
(3, 3.3, 'b')