kopia lustrzana https://github.com/martinlackner/apportionment
18 wiersze
480 B
Python
18 wiersze
480 B
Python
import apportionment.methods as app
|
|
|
|
|
|
with open("./nr_wahlen.txt", "r") as f:
|
|
|
|
for line in f:
|
|
year, partynames, votes, officialresult = eval(line)
|
|
print(year)
|
|
result = app.compute(
|
|
"dhondt", votes, 183, parties=partynames, threshold=0.04, verbose=True
|
|
)
|
|
# actual results
|
|
print(
|
|
"Identical with official result: "
|
|
+ (str(tuple(result) == tuple(officialresult)))
|
|
+ "\n\n"
|
|
)
|