Opens the file specified by the string filename. The mode parameter indicates whether the file is opened for reading ("r") or writing ("w"). A file object is returned.
Closes a previously opened file. Once closed, the file cannot be used until it has been reopened.
Reads the next line of text from an input file and returns it as a string. An empty string "" is returned when the end of file is reached.
Reads the next num characters from the input file and returns them as a string. An empty string is returned when all characters have been read from the file. If no argument is supplied, the entire contents of the file is read and returned in a single string.
Writes the string to a file opened for writing.
The movies.csv file contains data on thousands of movies with the following 5 fields in CSV format per movie.
"Name","Year","Directors","Producers","Actors"
Complete the program so that it reads the movies.csv file, filters the data for movies made between 1990 and 1999 (inclusive) and creates a new CSV file with just the following 3 fields,
"Name","Year","Actors"
Second Challenge: Modify the code so that you also filter movies which contain a specific actor name.
Run the program below to see the how it creates a new file called world_pop_densit.txt which is done by combining data from the two input files as described in the slides above.