- Due: Thursday, June 4th no later than 5pm.
- Submission instructions: complete the assigned number of activities in each of the assigned subsections of Chapter 11. You do not need to submit anything to Brightspace.
- Deadline reminder: once this deadline passes, Runestone Interactive will no longer allow you to collect points for completing the activities.
- 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
- Complete the required number of activities for each subsection in Files.
Grading - 10 points
- 10 points - the required number of activities were completed for each subsection before the deadline.
This reading assignment will be graded with scores in Brightspace by office hours the following class day.
- 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.