Chapter 12 - File I/O Flashcards

1
Q

What are two types of text file formats?

A

text file formats and binary file formats.

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

What method is used to open a file?

A

f = open(‘temp.txt’, ‘r’)

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

How do we read lines from a file?

A

f= open(‘temp.txt’. ‘r’)

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

What is the data type of a line read from a file?

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

What always appears at the end of a line read from a file?

A

f.close()

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