Name: Andrea Wu
For User, please CD to PYTHON-CHALLENGE file before running the script.
PyBank Work flow: The relative path would be to run the script would be: PyBank/main.py
- Get the path to current directory in case user are have download the file to different folder
- Get the path to read the csv file
- Create lists to store data from csv file and calculation
- Open and read the csv file
- Store header and data to list Reference: Class activity - Census
- Count and calculate the total month and amount
- Define variable to store greatest value
- Use for loop to calculate the change by month and compare the change with the previous greatest value.
- Calculate the average change
- Store all the result into a list
- Get the path to create analysis text file
- Use for loop to print result to text file and terminal
PyPoll Work flow: The relative path would be to run the script would be: PyPoll/main.py
- Get the path to current directory in case user are have download the file to different folder
- Get the path to read the csv file
- Create lists to store data from csv file and calculation
- Open and read the csv file
- Store header and data to list
- Count total vote
- Create unique list based on no. of candidate Reference: https://www.digitalocean.com/community/tutorials/get-unique-values-from-a-list-in-python
- Assign winner variable
- Use for loop to count vote for each candidate and find out the winner
- Store all the result into a list
- Get the path to create analysis text file
- Use for loop to print result to text file and terminal