Exam 6: Files and Exceptions
Exam 1: Introduction to Computers and Programming36 Questions
Exam 2: Input, Processing, and Output35 Questions
Exam 3: Decision Structures and Boolean Logic35 Questions
Exam 4: Repetition Structures34 Questions
Exam 5: Functions and Modules69 Questions
Exam 6: Files and Exceptions34 Questions
Exam 7: Lists and Tuples35 Questions
Exam 8: More About Strings35 Questions
Exam 9: Dictionaries and Sets35 Questions
Exam 10: Classes and Object Oriented Programming35 Questions
Exam 11: Inheritance35 Questions
Exam 12: Recursion35 Questions
Exam 13: GUI Programming35 Questions
Select questions type
An exception handler is a piece of code that is written using the try/except statement.
(True/False)
4.7/5
(87)
Which method could be used to strip specific characters from the end of a string?
(Multiple Choice)
4.8/5
(89)
Which method could be used to convert a numeric value to a string?
(Multiple Choice)
4.8/5
(79)
When a file has been opened using the 'r' mode specifier, which method will return the file's contents as a string?
(Multiple Choice)
4.8/5
(75)
If the last line in a file is not terminated with a \n, the readline method will return the line without a \n.
(True/False)
4.9/5
(78)
Closing a file disconnects the communication between the file and the program.
(True/False)
4.9/5
(81)
The term _______________ file is used to describe a file to which data is written.
(Short Answer)
4.8/5
(66)
Which mode specifier will open a file but will not let you change the file or write to it?
(Multiple Choice)
4.9/5
(88)
A(n) _______________ gives information regarding the line number(s) that caused an exception.
(Short Answer)
5.0/5
(93)
Programmers usually refer to the process of _______________ data in a file as "writing data to" the file.
(Short Answer)
4.8/5
(71)
Strings can be written directly to a file with the write method, but numbers must be converted to strings before they can be written.
(True/False)
4.9/5
(88)
The ZeroDivisionError exception is raised when the program attempts to perform a division by zero.
(True/False)
4.7/5
(77)
Which method will return an empty string when it has attempted to read beyond the end of a file?
(Multiple Choice)
4.8/5
(85)
Showing 21 - 34 of 34
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)