In first part of this challenge I wanted to analyze the profits and loss data from a hypothetical company. I wanted to answer the following questions:
-How many months were recorded?
-What is the net total?
-What is the average change from one month to the next?
-What is the greatest increase from one month to the next and when did that happen?
-What is the greatest decrease from one month to the next and when did that happen?.
Therefore, I created a Python script that looped through the data and displayed the answers to these questions in a .txt file in my Analysis folder. To run the script, use the terminal. Below is what that .txt file looks like.
In the second part of this challenge, I am doing a similar procedure for a small rural town's voting ballot information. Here are my new set of questions to answer:
-What is the total number of votes cast?
-What is the canidate names, what percent of votes he/she won, and how many votes did he/she earn?
-Who won?
Just like the first part, I created a Python script and wrote the answers to those questions into a .txt file. Below is what the .txt file looks like.