w5 Flashcards
(8 cards)
1
Q
advantages of files as lists of lines
A
can access lines in random order
able to specify encoding
more explicit about what its doing
2
Q
disadvantages of files with lines
A
needs enough memory to hold the whole file
3
Q
open(filename, “r”)
A
- acts like a bookmark after last character is read
4
Q
open(filename, “a”)
A
a acts to append at the end of an existing file
5
Q
open(filename, “w”)
A
bookmark updates after each write
6
Q
what is raise function used for
A
to identify exceptions
7
Q
read()
A
return whole data as a single string
8
Q
A