#Python's random, range and itertools.product make it easy to simulate 5 dice rolls:

>>> import random, itertools >>> dice = range(1, 7) >>> for _ in range(5): ... random.choice([p for p in itertools.product(dice, repeat=2)]) ... (1, 6) (6, 3) (4, 1) (1, 2) (4, 3)