Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def roll_dice(num):
- import random
- # possible score are 2,3, ....,11, 12 for two dice
- scores =[0]*11
- for i in range(num):
- dice1 = random.randint(1,6)
- dice2 = random.randint(1,6)
- total = (dice1 + dice2)-2
- scores[total]= scores[total] + 1
- return scores
- print(roll_dice(100))
Advertisement
Add Comment
Please, Sign In to add comment