Hare-Clark Voting Results Calculator | Python

Language: Python
Editor: VSCode
Repository: https://github.com/zuggyg/hare-clark

Purpose:
In Australia we use preferential voting. It is a bit more complicated in calculating the winner compared to other voting systems, but it is considered the fairest system. Things become even more complicated when there are multiple seats up for grab, such as in the Australian Senate or ACT Parliament. I thought it would be a great programming challenge to create a results calculator for an election using the the Hare-Clark model.

Tasks:
The first task was to understand how the votes would be calculated manually. There are various websites and videos that provide this information, I have linked this one pager by the Australian Electoral Commission for easy reference.
The complexity of the task merited planning out the different aspects of the project before jumping into a code editor. This was a particularly novel challenge for me as I needed to create temporary data that needed to be stored for further calculation later.
Due to the importance placed on the output of the script I wanted to make sure I added plenty of commenting for anyone auditing the code and also plenty of print() functions to provide as much information to the user throughout the vote counting process.

Skills:
– Designing and planning a complicated multi-day project
– Saving temporary data to be picked up again in later calculations
– Detailed commenting and using understandable variables for auditors
– Presenting a transparent calculation process for users

Basics Practiced:
– Loops
– Try/Catch Blocks
– Reading File Inputs
– Taking specific user inputs
– Multidimensional Arrays