Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 1018 Bytes

README.md

File metadata and controls

36 lines (24 loc) · 1018 Bytes

PyHondt

Simple Python script that calculates the number of seats according to the D'Hondt method.


Prerequisites

  • Python2 / Python3

You don't need to do anything with csv module since it is included in the Python installation.


Usage

  1. Fill the columns after the "seats" column with the name of all parties.

  2. Write the names of constituencies to the first column of each row and number of seats to the second column of each row.

  3. If a party did not nominate a candidate in a constituency or did not receive votes, write 0 there. (Do not leave it blank!)

  4. Run the main.py file.

    python main.py

Input / Output

Sample Input

Sample Input

Sample Output

Sample Output


Special notes on Turkish election system:

  • sample_input.csv dosyasındaki bölgeler ve koltuk sayıları Mart 2021 tarihli YSK kararından alınmıştır. Zaman içerisinde nüfus değişimine göre değişiklik gösterebilir.