A Colorado Board of Elections employee has given you 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.67.1
The analysis of the election shows 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 the vote and 85,213 votes.
- Diana DeGette received 73.8% of the vote and 272,892 votes.
- Raymon Anthony Doane received 3.1% of the vote and 11,606 votes.
The winner of the election was:
- Diana DeGette, who received 73.8% of the vote with 272,892 votes.
The Colorado Board of Elections employee has requested additional information for the election audit of the congressional election.
- The voter turnout for each county.
- The percentage of votes from each county out of the total votes.
- The county with the highest turnout.
-
A total of 369,711 votes were cast in the election.
-
Votes by county:
-
The largest voter turnout was in Denver County
-
Candidate total votes and percentages:
-
The winning candidate was:
The attached script can easily be modified for use in future elections. Sample modifications include:
Please let us know if you need any additional changes and we look forward to working with you on future elections.