Exam 6: Files and Exceptions
Exam 1: Introduction to Computers and Programming39 Questions
Exam 2: Input, Processing, and Output40 Questions
Exam 3: Decision Structures and Boolean Logic40 Questions
Exam 4: Repetition Structures41 Questions
Exam 5: Functions66 Questions
Exam 6: Files and Exceptions40 Questions
Exam 7: Lists and Tuples40 Questions
Exam 8: More About Strings37 Questions
Exam 9: Dictionaries and Sets39 Questions
Exam 10: Classes and Object-Oriented Programming38 Questions
Exam 11: Inheritance36 Questions
Exam 12: Recursion35 Questions
Exam 13: Gui Programming42 Questions
Select questions type
If a file with the specified name already exists when the file is opened and the file is opened in 'w' mode,then an alert will appear on the screen.
(True/False)
4.9/5
(31)
A(n)__________ access file is also known as a direct access file.
(Multiple Choice)
4.8/5
(44)
The ZeroDivisionError exception is raised when the program attempts to perform the calculation x/y if y = 0.
(True/False)
4.9/5
(44)
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.8/5
(32)
When a program needs to save data for later use,it writes the data in a(n)___________.
(Short Answer)
4.9/5
(44)
Which mode specifier will open a file but not let you change the file or write to it?
(Multiple Choice)
4.9/5
(37)
When data is written to a file,it is described as a(n)__________ file.
(Short Answer)
4.9/5
(43)
Programmers usually refer to the process of __________ data in a file as writing data to the file.
(Short Answer)
4.9/5
(32)
A(n)__________ file contains data that has not been converted to text.
(Short Answer)
4.8/5
(38)
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.9/5
(39)
Which of the following is associated with a specific file and provides a way for the program to work with that file?
(Multiple Choice)
4.9/5
(29)
A(n)___________ access file retrieves data from the beginning of the file to the end of the file.
(Short Answer)
4.9/5
(37)
Which method will return an empty string when it has attempted to read beyond the end of a file?
(Multiple Choice)
4.9/5
(44)
What will be the output after the following code is executed and the user enters 75 and 0 at the first two prompts?


(Multiple Choice)
4.7/5
(39)
Which method could be used to convert a numeric value to a string?
(Multiple Choice)
4.7/5
(29)
Closing a file disconnects the communication between the file and the program.
(True/False)
4.8/5
(31)
Which of the following describes what happens when a piece of data is written to a file?
(Multiple Choice)
4.9/5
(32)
An exception handler is a piece of code that is written using the try/except statement.
(True/False)
4.9/5
(35)
Showing 21 - 40 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)