fork(3) download
  1. import itertools
  2. animals = ['dog', 'cat']
  3. numbers = [5, 45, 8, 9]
  4. colors = ['yellow', 'blue', 'black']
  5. for animal, number, color in itertools.product(animals, numbers, colors):
  6. print "Animal is {0}, number is {1}, and color is {2}".format(animal, number, color)
Success #stdin #stdout 0.01s 7728KB
stdin
Standard input is empty
stdout
Animal is dog, number is 5, and color is yellow
Animal is dog, number is 5, and color is blue
Animal is dog, number is 5, and color is black
Animal is dog, number is 45, and color is yellow
Animal is dog, number is 45, and color is blue
Animal is dog, number is 45, and color is black
Animal is dog, number is 8, and color is yellow
Animal is dog, number is 8, and color is blue
Animal is dog, number is 8, and color is black
Animal is dog, number is 9, and color is yellow
Animal is dog, number is 9, and color is blue
Animal is dog, number is 9, and color is black
Animal is cat, number is 5, and color is yellow
Animal is cat, number is 5, and color is blue
Animal is cat, number is 5, and color is black
Animal is cat, number is 45, and color is yellow
Animal is cat, number is 45, and color is blue
Animal is cat, number is 45, and color is black
Animal is cat, number is 8, and color is yellow
Animal is cat, number is 8, and color is blue
Animal is cat, number is 8, and color is black
Animal is cat, number is 9, and color is yellow
Animal is cat, number is 9, and color is blue
Animal is cat, number is 9, and color is black