This Python programme calculates how many seats each party will get according to the given inputs using D'Hondt method.
You need to enter the party names that is going to take place in the election. Election is supposed to be country-wide; therefore, vote ratio of the party will be asked in order to calculate, whether the party is above the barrage or not.
Then the programme will ask for the alliances if any. After that you need to enter how many districts are there existing in the country. Finally, in a while loop programme going to ask you how many representatives needs to be calculated in the spesific district.
- Alliance classification
- Able to calculate votes and seat allocations according to given joint list
- Parties with votes under the barrage won't be included in the calculation (also the barrage will be determined by the user)
Disclaimer: It has been assumed that ratio input will be given as the same order as party names. Furthermore, each party name and each ratio value should be splitted with a comma (,).
In the output, code will provide which party will be getting how many seats. Programme will continue until all the seat allocations calculated for each district. Additionally, you can exit the loop of asking representative and vote numbers by simply typing exit when the votes input is asked.