Exam 7: files and Exceptions

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

A filename _______________ is a short sequence of characters that appear at the end of a filename preceded by a period.

Free
(Short Answer)
4.8/5
(38)
Correct Answer:
Verified

extension

What statement can be used to handle some of the run-time errors in a program?

Free
(Multiple Choice)
4.9/5
(47)
Correct Answer:
Verified

C

The term _______________ file is used to describe a file to which data is written.

Free
(Short Answer)
4.9/5
(37)
Correct Answer:
Verified

output

The ZeroDivisionError exception is raised when the program attempts to perform a division by zero.

(True/False)
4.8/5
(43)

The term _______________ file is used to describe a file from which the program gets data.

(Short Answer)
4.8/5
(38)

Which method will return an empty string when it has attempted to read beyond the end of a file?

(Multiple Choice)
4.9/5
(46)

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
(44)

A(n) _______________ access file retrieves data from the beginning of the file to the end of the file.

(Short Answer)
4.9/5
(35)

A(n) _______________ gives information regarding the line number(s) that caused an exception.

(Short Answer)
4.9/5
(47)

Python allows the programmer to work with text and number files.

(True/False)
4.8/5
(36)

A(n) _____ access file is also known as a direct access file.

(Multiple Choice)
4.9/5
(32)

What type of file access jumps directly to any piece of data in a file without reading the data that came before it?

(Multiple Choice)
5.0/5
(29)

A(n) _______________ includes one or more statements that can potentially raise an exception.

(Short Answer)
4.8/5
(42)

When a piece of data is read from a file, it is copied from the file into the program.

(True/False)
4.9/5
(37)

What happens when a piece of data is written to a file?

(Multiple Choice)
4.9/5
(48)

Which step creates a connection between a file and a program?

(Multiple Choice)
4.8/5
(40)

Which method could be used to strip specific characters from the end of a string?

(Multiple Choice)
4.7/5
(35)

Closing a file disconnects the communication between the file and the program.

(True/False)
4.8/5
(36)

In Python, there is nothing that can be done if the program tries to access a file to read that does not exist.

(True/False)
4.9/5
(35)

Assume that the customer file references a file object, and the file was opened using the 'w' mode specifier. How would you write the string 'Mary Smith' to the file?

(Multiple Choice)
4.8/5
(44)
Showing 1 - 20 of 35
close modal

Filters

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