Exam 6: Files and Exceptions

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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)

How many types of files are there?

(Multiple Choice)
4.8/5
(78)

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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)