Files Quiz - Data Science Masters - PW Skills
Files Quiz - Data Science Masters - PW Skills
When you open a file for reading, if the file does not exist, an error occurs
When you open a file for writing, if the file does not exist, a new file is created
When you open a file for writing, if the file exists, the existing file is overwritten with the new file
closed
softspace
rename
mode
Explanation: rename is not the attribute of file rest all are files attributes. Attribute Description file.closed Returns
true if file is closed, false otherwise. file.mode Returns access mode with which file was opened. file.name
Returns name of the file. file.softspace Returns false if space explicitly required with print, true otherwise.
FileStream
FileInputStream
BUfferedOutputStream
https://learn.pwskills.com/quiz/-Files-quiz/63e7b4f1194b220eaee5abe5/course/Data-Science-masters/63a2eb428899436daf7eb489 1/3
3/3/23, 4:06 AM Files quiz - Data Science masters | PW Skills
FileBufferStream
Explanation: None.
get()
read()
scan()
readFileInput()
Explanation: Each time read() is called, it reads a single byte from the file and returns the byte as an integer
value. read() returns -1 when the end of the file is encountered.
function
module
variable
datatype
Explanation: The logging module in Python is a ready-to-use and powerful module that is designed to meet the
needs of beginners as well as enterprise teams. It is used by most of the third-party Python libraries, so you can
integrate your log messages with the ones from those libraries to produce a homogeneous log for your
application.
debug
warming
error
Explanation: Debug is the lowest logging level, it's used to log some diagnostic information about the application.
logger
https://learn.pwskills.com/quiz/-Files-quiz/63e7b4f1194b220eaee5abe5/course/Data-Science-masters/63a2eb428899436daf7eb489 2/3
3/3/23, 4:06 AM Files quiz - Data Science masters | PW Skills
filter
critical
Explanation: "filter" is not a logging function in Python. It is actually a logging concept that allows you to control
the flow of log messages based on a set of rules. Filters can be used to exclude certain log messages, based on
their logging level, source, or any other criterion. Filters are specified using the addFilter method of a logger
object.
Fixing
Isolating
Identifying
Testing
Explanation: Testing is a different process and is different from debugging. Debugging involves identifying,
isolating and fixation of the problems or errors.
Explanation: The import statement is used to import a module into a Python program, allowing you to use its
definitions and statements. By using the import statement, you can access all the variables, functions, and
classes defined in the imported module. You can then use them in your program as if they were defined locally.
importlib.reload function.
import reload
import logging
Explanation: The importlib.reload function reloads a previously imported module, allowing you to pick up changes
that have been made to the module's code. This is useful in situations where you are developing a module and
need to test changes without restarting your program.
https://learn.pwskills.com/quiz/-Files-quiz/63e7b4f1194b220eaee5abe5/course/Data-Science-masters/63a2eb428899436daf7eb489 3/3