We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a63dd9 commit ab3ce43Copy full SHA for ab3ce43
src/governance.py
@@ -0,0 +1,17 @@
1
+class Governance:
2
+ def __init__(self):
3
+ self.proposals = []
4
+ self.votes = {}
5
+
6
+ def propose_change(self, proposal):
7
+ self.proposals.append(proposal)
8
+ self.votes[proposal] = []
9
10
+ def vote(self, proposal, voter, decision):
11
+ if proposal in self.proposals:
12
+ self.votes[proposal].append((voter, decision))
13
14
+ def tally_votes(self, proposal):
15
+ if proposal in self.votes:
16
+ return sum(1 for _, decision in self.votes[proposal] if decision)
17
+ return 0
0 commit comments