Lesson 12: Rolling dice
Post date: Jan 30, 2019 4:02:36 PM
import random
#print(random.randint(1,6))
result = []
for i in range(0, 10000):
a = random.randint(1,6)
result.append(a)
#print(result)
print("Rolling one dice:")
for i in range (1,7):
a = result.count(i)
print(i, a)
result2 = []
for i in range(0, 1000000):
a = random.randint(1,6)
b = random.randint(1,6)
result2.append(a + b)
print("Rolling two dice:")
for i in range(2,13):
a = result2.count(i)
print(i, a)