repl.it
@F_tafoya/

OvalSqueakyBrowsers

Python

No description

fork
loading
Files
  • main.py
  • moneylist.png
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
43
44
45
46
47
48
49
import random
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
moneylist=[]
for i in range(100) :
  money=100
  for i in range(100) :
    roll1=random.randint(1,6)
    roll2=random.randint(1,6)
    rolltotal= (roll1+roll2)
    print(roll1+roll2)
    if rolltotal==7 :
      money=money+3
    elif rolltotal==11 :
      money=money+3
    elif roll1==roll2 :
      money=money+3
    else :
      money=money-1
  print(money)
  moneylist.append(money)
print(moneylist)
plt.hist(moneylist,bins=20)
plt.show()
plt.savefig('moneylist.png')
plt.clf()
print(np.mean(moneylist))
print(np.std(moneylist))



    
  






  
  
  

  
  
    
    
Fetching token
?