repl.it
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import random

# # 28

# s = 0

# for i in range(10):
#   i, o, l = 0, 0, []

#   while o < 3:
#     l.append(random.randint(0, 99))
#     o += l[-1] < 44
#     i += 1
  
#   s += i

#   print(*[str(x) for x in l], "...", i)
#   print(*["O " if x < 44 else ". " for x in l])
#   print()

# print("avg", s / 10)

# # 34

# s = 0

# for i in range(10):
#   i, o, l = 0, 0, []

#   while True:
#     a, b = random.randint(1, 6), random.randint(1, 6)
#     l.append((a, b))
#     i += 1
#     if a == 3 or b == 3 or a + b == 3:
#       break
  
#   s += i

#   print(*[str(a * 10 + b) for a, b in l], "...", i)
#   print(*["O " if a == 3 or b == 3 or a + b == 3 else ". " for a, b in l])
#   print()

# print("avg", s / 10)

# A47 19

s = 0

for i in range(10):
  l = random.sample(range(0, 9), 5)

  num = len([x for x in l if x % 2 == 0])
  award = [-10, -10, -10, 10, 20, 50][num]
  s += award
  
  print(*[str(x) for x in l], "...", award)
  print(*["O" if x % 2 == 0 else "." for x in l])
  print()

print("avg", s / 10)
Fetching token
?