Ch. 6

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Which mode specifier will open a file but will not let you change the file or write to it? 'w' 'r' 'a' 'e'

'r'

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

'w'

How many types of files are there? One Two Three Four

Two

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? customer_file.write('Mary Smith') customer.write('w','Mary Smith') customer.input('Mary Smith') customer.write('Mary Smith')

customer.write('Mary Smith')

When a file has been opened using the 'r' mode specifier, which method will return the file's contents as a string? write input get read

read

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

readline

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

rstrip

Which method could be used to convert a numeric value to a string? str value num ch

str

Which step creates a connection between a file and a program? Open the file. Read the file. Process the file. Close the file.

Open the file

What do you call the process of retrieving data from a file? Retrieving data Reading data Input data Get data

Reading data


संबंधित स्टडी सेट्स

ENG 3B UNIT 1 Voices of Modernism (1920s - 1940s) LESSON 12 Voices of Modernism (1920s - 1940s) Unit Test : Modernism

View Set

70-410 Installing and Configuring Microsoft Windows Server 2012

View Set

Nutrition Final- 1st half of quizzes

View Set

Adjective: a word, phrase, or clause that describes a noun or pronoun. Adverb: a word, phrase, or clause that modifies the meaning of a verb, adjective, or other adverb. Conjunction: a word or phrase that links words, phrases, clauses, or sentences. No

View Set

Chapter 30 Pretest: Assisting in Ophthalmology and Otolaryngology

View Set

Test Review. Module 1. Advanced Med Surg.

View Set

Critical Thinking and Logic - C168: Question Set #1

View Set