I am not sure if this is what you want to accomplish, but I HTH:
import random
def roll_dice(stop=100):
# roll five dice and summarize the occurrances of duplicate numbers
cnt = 1
dd = {}
while cnt <= stop:
dice = [random.randrange(1,7) for _ in range(5)]
# eliminate duplicates, Python 2.3
dice1 = [i for i in dice if i not in locals()['_[1]'].__self__]
if len(dice1) == 1:
print dice
try:
dd[len(dice1)] = dd[len(dice1)]+1
except:
dd[len(dice1)] = 1
cnt += 1
return dd
dd = roll_dice(1000)
>>> [2, 2, 2, 2, 2]
[2, 2, 2, 2, 2]
>>> dd
{1: 2, 2: 95, 3: 482, 4: 384, 5: 37}
>>>