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.'
['The sun did not shine.', 'It was too wet to play.']
'The sun did not shine. It was too wet to play.'
['The sun did not shine.\n', 'It was too wet to play.\n']
2
What is the result of the following script?
Error
None
False
True
3
Which of these commands can be used to read the content in a file object f as a single string?
f.read(n)
f.readline()
f.read()
f.readlines()
4
What will happen if you run the following script, but "test.txt" does not exist?
Creates "test.txt", opens in read mode
Doesn't create "test.txt", no error message
Creates "test.txt", opens in append mode
Error message
5
Which of the following commands can be used to read n # of characters from a file object f?
f.readlines()
f.readline()
f.read(n)
f.read()
6
The readlines() method returns...
a list of single characters
a list of integers
str
a list of lines
7
What does the following script do?
Opens test.txt for both reading and writing
Doesn't actually open test.txt
Opens test.txt for reading only
Opens test.txt file for writing only
8
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."
9
What does the following script do?
Opens test.txt file for reading only
Opens test.txt file in god mode
Opens test.txt file for both reading and writing
Opens test.txt file for writing only