This repository has been moved to codeberg
A simple calculator to assign seats from an election based on the D'Hont method.
First it will prompt you to insert a maximum number of parties, their name and what their electoral result is. After that it will ask how many seats need to be assigned, then it will do the following loop untill all seats are assigned:
- Find the biggest value among the electoral results
- Memorize its position
- Add 1 seat to the party in that position
- Divide that party's electoral result by 2
- Repeat
- Python 3.11.3 onwards
- Colorama module for python
- Download the file and save it wherever you like
- Run from a terminal using
python /path/to/calculadhont.py
(note: usepython3 ...
on Windows)
Browser version available here.