stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
CIT590 Recitation 6 Flashcards | StudBud
Explore
/
CIT590 Recitation 6
CIT590 Recitation 6
9 terms
·
StudBud Administration
·
94 plays
CIT590 recitation 6
Flashcards
9 cards
F
Practice quiz
P
Host live
L
Questions
9
Answers
1
What is the result of the following script?
['The sun did not shine.\n', 'It was too wet to play.\n']
['The sun did not shine.', 'It was too wet to play.']
'The sun did not shine.\n It was too wet to play.'
'The sun did not shine. It was too wet to play.'
2
What will happen if you run the following script, but "test.txt" does not exist?
Doesn't create "test.txt", no error message
Creates "test.txt", opens in append mode
Creates "test.txt", opens in read mode
Error message
3
What is the result of the following script?
Error message
"I sat there with Sally."
["The sun did not shine."]
"The sun did not shine."
4
What does the following script do?
Opens test.txt for reading only
Opens test.txt for both reading and writing
Doesn't actually open test.txt
Opens test.txt file for writing only
5
What does the following script do?
Opens test.txt file in god mode
Opens test.txt file for writing only
Opens test.txt file for reading only
Opens test.txt file for both reading and writing
6
Which of the following commands can be used to read n # of characters from a file object f?
f.readline()
f.readlines()
f.read()
f.read(n)
7
The readlines() method returns...
a list of integers
str
a list of single characters
a list of lines
8
Which of these commands can be used to read the content in a file object f as a single string?
f.read()
f.read(n)
f.readlines()
f.readline()
9
What is the result of the following script?
True
None
Error
False