**All questions refer to the use of Python** when opening a file, the “wt” param
ID: 3572661 • Letter: #
Question
**All questions refer to the use of Python**
when opening a file, the “wt” parameter indicated that we:
want to append to the end of the text file.
want to write data to a text file.
that we are opening a binrary file.
that we are reading from a text file.
1 points
QUESTION 2
when opening a file, the “rt” parameter indicated that we:
want to append to the end of the text file.
want to write data to a text file.
that we are opening a binary file.
that we are reading from a text file.
1 points
QUESTION 3
when using the ‘with’ keyword and opening a file, we must remember to close the file once we are done.
True
False
1 points
QUESTION 4
the import command can be used to bring into your Python program, additional code contained in other Python code files.
True
False
1 points
QUESTION 5
Which keyword is used in conjunction with the import command to selectively import objects from an external python code file?
from
for
include
eval
1 points
QUESTION 6
You can set an infinite loop using the command: while True:
True
False
1 points
QUESTION 7
Where can you learn more about pre-built python modules that can be used in your python program?
Python Reference website
Python community site
Python Library Reference website
All of the above
1 points
QUESTION 8
An important component to becoming an effective programmer is:
Existing knowledge
Research
Reinventing the wheel
Having a good IDE
1 points
QUESTION 9
We can open and access a text file directly and do not have to create a file object.
True
False
1 points
QUESTION 10
Accessing a text file requires the text file to be created before we can open the file using the “wt” parameter.
True
False
want to append to the end of the text file.
want to write data to a text file.
that we are opening a binrary file.
that we are reading from a text file.
Explanation / Answer
ANSWER 1:
want to write data to a text file.
Explanation:
't' refers to the text mode.There is no difference between
'w' and 'wt' since text mode is the default.
ANSWER 2:
that we are reading from a text file.
Explanation:
'r' means open for reading.
There is no difference between 'r' and 'rt' since text mode is
the default.
ANSWER 3:
FALSE
Explanation:
with statement will automatically close the file after the
nested block of code. (Continue reading to see exactly how the
close occurs.) The advantage of using a with statement is that
it is guaranteed to close the file no matter how the nested block
exits.
ANSWER 4:
TRUE
Explanation:
they allow you to use functions defined elsewhere
(either in a standard module, or your own).
ANSWER 5:
from
Explanation:
it is a variant of the import statement that imports names from a module
directly into the importing module’s symbol table.
ANSWER 6:
TRUE
Explanation:
'while True' is true always.Hence, This is an infinite loop until
some condition will come to terminate it.
ANSWER 7:
All the above
Explanation:
All are used for leaning about pre-built python modules.
ANSWER 8:
Existing Knowledge
its very neccessary to have existing knowledge.
ANSWER 9:
FALSE
Explanation: Without file object we can't access file.
ANSWER 10:
FALSE
Explanation:
it won't require, 'wt' is for writing which will
write into the file after creating by itself.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.