@TristinKeenan/

Random Dice Counter

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import random
rolls = 0
n2 = 0
n3 = 0
n4 = 0
n5 = 0
n6 = 0
n7 = 0
n8 = 0
n9 = 0
n10 = 0
n11 = 0
n12 = 0
while rolls <= 1000:
  d1 = random.randint(1,6)
  d2 = random.randint(1,6)
  total = d1 + d2
  rolls = rolls + 1
  if total == 2:
    n2 = n2 + 1  
  elif total == 3:
    n3 = n3 + 1  
  elif total == 4:
    n4 = n4 + 1  
  elif total == 5:
    n5 = n5 + 1  
  elif total == 6:
    n6 = n6 + 1  
  elif total == 7:
    n7 = n7 + 1  
  elif total == 8:
    n8 = n8 + 1  
  elif total == 9:
    n9 = n9 + 1  
  elif total == 10:
    n10 = n10 + 1  
  elif total == 11:
    n11 = n11 + 1  
  else:
    n12 = n12 + 1  
  
print("2 = ",n2,n2/rolls*100, "\n3 = ", n3,n3/rolls*100,"\n4 = ", n4,n4/rolls*100,"\n5 = ", n5,n5/rolls*100,"\n6 = ", n6,n6/rolls*100,"\n7 = ", n7,n7/rolls*100,"\n8 = ", n8,n8/rolls*100,"\n9 = ", n9,n9/rolls*100,"\n10 = ", n10,n10/rolls*100,"\n11 = ", n11,n11/rolls*100,"\n12 = ", n12,n12/rolls*100,)