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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

disadvantages of files with lines

A

needs enough memory to hold the whole file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

open(filename, “r”)

A
  • acts like a bookmark after last character is read
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

open(filename, “a”)

A

a acts to append at the end of an existing file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

open(filename, “w”)

A

bookmark updates after each write

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is raise function used for

A

to identify exceptions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

read()

A

return whole data as a single string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly