Arrangements and Combinations · Basic Rules
Lesson 5
Product Rule: If there are \(n\) objects of the first type and \(k\) objects of the second type, then there are \(n \times k\) pairs of objects, the first of which is of the first type, and the second of the second type.
from itertools import product
for t in product({'e', 'u'}, {8, 2, 5}):
print(*t)e 8
e 2
e 5
u 8
u 2
u 5
You can think of it as simply choosing a cell in a table with \(n\) rows and \(k\) columns.

