-
What is a file?
a linear arrangement of data on a storage medium
-
What are the two things that uniquely specify a file?
name and location
-
What must you create to work with a file in Python?
a file object
-
What is the Python function that creates the thing you need to work with a file?
open
-
What two things does this function do?
creates a file object and returns a reference to it
-
What two pieces of information do you need to give this function as arguments?
pathname and access mode
-
What are the three ways you can open a file?
reading, writing, appending
-
What are the two things that make up a pathname?
path to the file (location) and name of file
-
If I have a variable named file, what is the Python
statement I would write to write the work "hello" to the file?
file.write("hello")
-
What is the name of the method used to read the ENTIRE
contents of a file?
read