Skip to content

Conversation

@javi0martinez
Copy link

PR Title

D'Hondt calculator

Summary

This script can be used to get the alocated seats from the results of an election

Description

You can simulate the seats allocation by entering the number of seats to allocate, the number of parties, the name and the votes from each party

The changes are as follows:

This is the first addition

Checks

in the repository

  • Made no changes that degrades the functioning of the repository
  • Gave each commit a better title (unlike updated README.md)

in the PR

  • Followed the format of the pull_request_template
  • Made the Pull Request in a small level (for the creator's wellfare)
  • Tested the changes you made

Thank You,

Javi

javi0martinez and others added 7 commits November 19, 2025 23:00
Introduces the main.py file with a function for positive integer input validation and creates a placeholder readme.md for documentation.
Introduced a new function `calculate_dhondt_seats` in utils.py to compute seat allocation using the D'Hondt method. Updated main.py to use this function and print the seat allocation results. Refactored imports for clarity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant