Filters
Question type

Study Flashcards

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.

Correct Answer

verifed

verified

Which of these is associated with a specific file and provides a way for the program to work with that file?


A) Filename
B) Extension
C) File object
D) File variable

Correct Answer

verifed

verified

When a program needs to save data for later use, it writes the data in a(n) _______________.

Correct Answer

verifed

verified

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?


A) customer_file.write('Mary Smith')
B) customer.write('w','Mary Smith')
C) customer.input('Mary Smith')
D) customer.write('Mary Smith')

Correct Answer

verifed

verified

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


A) sequential
B) random
C) numbered
D) text

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

Which mode specifier will erase the contents of a file if it already exists and create it if it does not exist?


A) 'w'
B) 'r'
C) 'a'
D) 'e'

Correct Answer

verifed

verified

What do you call the process of retrieving data from a file?


A) Retrieving data
B) Reading data
C) Input data
D) Get data

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

A(n) _______________ file contains data that has not been converted to text.

Correct Answer

verifed

verified

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


A) Data is copied from a variable in RAM to a file.
B) Data is copied from a variable in the program to a file.
C) Data is copied from the program to a file.
D) Data is copied from a file object to a file.

Correct Answer

verifed

verified

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


A) Open the file.
B) Read the file.
C) Process the file.
D) Close the file.

Correct Answer

verifed

verified

A

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


A) Sequential
B) Random
C) Number
D) Text

Correct Answer

verifed

verified

It is possible to create a while loop that determines when the end of a file has been reached.

Correct Answer

verifed

verified

True

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

Correct Answer

verifed

verified

A(n) _______________ file contains data that has been encoded as text, using a scheme such as ASCII.

Correct Answer

verifed

verified

Text

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

Showing 1 - 20 of 34

Related Exams

Show Answer