Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

D-Hondt.py

This Python programme calculates how many seats each party will get according to the given inputs using D'Hondt method.

ABOUT INPUTS

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.

WHAT CAN BE DONE?

  1. Alliance classification
  2. Able to calculate votes and seat allocations according to given joint list
  3. Parties with votes under the barrage won't be included in the calculation (also the barrage will be determined by the user)

DISCLAIMER

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 (,).

OUTPUT

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.

About

This Python programme calculates how many seats each party will get according to the given inputs.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors