Skip to content

Instantly share code, notes, and snippets.

@techvet
Created November 13, 2014 15:26
Show Gist options
  • Select an option

  • Save techvet/3e4235b17e0f55772788 to your computer and use it in GitHub Desktop.

Select an option

Save techvet/3e4235b17e0f55772788 to your computer and use it in GitHub Desktop.
import random
count = 0
roll_totals = []
while count <= 10000:
dice_1 = random.randrange(1,7)
dice_2 = random.randrange(1,7)
total = dice_1 + dice_2
roll_totals.append(total)
count += 1
print_count = 2
while print_count <=12:
print '{0}: '.format(print_count), (roll_totals.count(print_count)/10000.00) * 100
print_count += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment