Python Reading
- Read the chapter entitled Files from section "Alternative File Reading Methods" through section "Writing Text Files".
Key Ideas
- File Reading Methods
- filevar.readline() - in conjunction with a while loop to read an entire file
- filevar.readlines()
- File Writing Methods
- filevar.write(some_string)
- Experiment with census-2.py and census2020.txt until you fully understand census-2.py
Active Learning
- Download and open the CSV (comma seperated values) file census2020.csv in a text editor and also in a spreadsheet program
- Create a Python program that prompts the user for upper and lower bounds on a populations range (in millions)
- Write a function that returns a listing of states within the population range given by the user.
- Work Exercise 5 without looking at the answer.