Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132928 views
License: OTHER
1
class fifty_is_good():
2
def step(self, history, round_num):
3
other_idx = 1 - self.order
4
try:
5
prob = sum(history[other_idx])/len(history[other_idx])
6
except ZeroDivisionError:
7
prob = 0
8
if prob >= 0.5:
9
return 0
10
else:
11
return 1
12
13