A Colarado Board of Elections employee, Tom, has given me the following tasks to complete the election audit of a recent local congressional election.
- Calculate the total number of votes cast.
- Get a complete list of candidates who received votes.
- Calculate the total number of votes each candidate received.
- Calculate the percentage of votes each candidate won.
- Determine the winner of the election based on popular vote.
- Data Source: election_results.csv
- Software: Python 3.7.6, Visual Studio Code, 1.43
The analysis of the election show that:
- There were 369,711 votes cast in the election.
- The candidates were:
- Charles Casper Stockham
- Diana DeGette
- Raymon Anthony Doane
- The candidate results were:
- Charles Casper Stockham received 23.0% of vote and 85,213 number of votes.
- Diana DeGette received 73.8% of vote and 272,892 number of votes.
- Raymon Anthony Doane received 3.1% of vote and 11, 606 number of votes.
- The winner of the election was:
- Diana DeGette, who received 73.8% of the vote and 272,892 number of votes.
Because not everyone has voted in this election, I will confirm the voter turnout for each county. In this project, I determined the number of votes that were cast from each county and the percentage of votes each county contributed to the election.
First, I used for loops and conditional statements to calculate the voter turnout for each county as well as the percentage of votes each county contributed to the election. Then, determined which county had the largest turnout. The results were saved to election_results.txt with the previous election analysis results.
- Calculate the total number of voters.
- Add the list of counties.
- Calculate the total number of voters from each county.
- Calculate the percentage of voters in each county.
- Determine the largest county turnout.
The analysis of the election shows that:
- There were 369,711 votes(voters) cast in the election.
- The counties were:
- Arapahoe
- Denver
- Jefferson
- The turnout of each county were:
- Arapahoe got 24,801 voters which is 6.7% voter turnout rate.
- Denver got 306,055 voters which is 82.8% voter turnout rate.
- Jefferson got 38,855 voters which is 10.5% voter turnout rate.
- The county with the largest voter turnout is Denver.