kopia lustrzana https://github.com/martinlackner/apportionment
output formatting
rodzic
63561beedd
commit
a1951c863e
|
@ -6,12 +6,14 @@ import apportionment
|
|||
with open("./nr_wahlen.txt", "r") as f:
|
||||
|
||||
for line in f:
|
||||
result = eval(line)
|
||||
print(result[0])
|
||||
print(apportionment.method("dhondt", result[2],
|
||||
sum(result[3]),
|
||||
parties=result[1],
|
||||
threshold=.04,
|
||||
verbose=False))
|
||||
year, partynames, votes, officialresult = eval(line)
|
||||
print(year)
|
||||
result = apportionment.method("dhondt", votes,
|
||||
183,
|
||||
parties=partynames,
|
||||
threshold=.04,
|
||||
verbose=True)
|
||||
# actual results
|
||||
print(result[3])
|
||||
print("Identical with official result: "
|
||||
+ (str(tuple(result) == tuple(officialresult)))
|
||||
+ "\n\n")
|
||||
|
|
Ładowanie…
Reference in New Issue