From chapter 11
- Opening a file. Example: qbdata.txt.
- Reading from a file:
- Writing to a file:
- Closing a file:
- File reading methods
filevar.readline()- in conjunction with a while loop to read an entire file
- File writing methods
- Absolute File Paths vs. Relative File Paths
- Using a for loop, write a program that reports the average population across all states.
- Edit your existing program to use a while loop and the readline() function.
Edit your program from Activity 1 to write a file called census_percentages.txt that reports the percentage of the total population for each state, in the same order as census.txt. The file you write should look like this.