Q:

1. What is a relative path relative to?
Relative paths are relative to the current working directory.

Q:

2. What does an absolute path start with?
Absolute paths start with the root folder, such as / or C:\.

Q:

3. What do the os.getcwd() and os.chdir() functions do?
The os.getcwd() function returns the current working directory. The os.chdir() function changes the current working directory.

Q:

4. What are the . and .. folders?
The . folder is the current folder, and .. is the parent folder.

Q:

5. In C:\bacon\eggs\spam.txt, which part is the dir name, and which part is the base name?
C:\bacon\eggs is the dir name, while spam.txt is the base name.

Q:

6. What are the three “mode” arguments that can be passed to the open() function?
The string 'r' for read mode, 'w' for write mode, and 'a' for append mode

Q:

7. What happens if an existing file is opened in write mode?
An existing file opened in write mode is erased and completely overwritten.

Q:

8. What is the difference between the read() and readlines() methods?
The read() method returns the file’s entire contents as a single string value. The readlines() method returns a list of strings, where each string is a line from the file’s contents.

Q:

9. What data structure does a shelf value resemble?
A shelf value resembles a dictionary value; it has keys and values, along with keys() and values() methods that work similarly to the dictionary methods of the same names.