Starting Out with Python (4th Edition)
4th Edition
ISBN: 9780134444321
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 6, Problem 3MC
Before a file can be used by a
a. formatted
b. encrypted
c. closed
d. opened
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
A student wants to write into a file called myfile, without deleting its existing content. Which one of the following functions should he or she use?
f = open('myfile', 'r')
f = open('myfile', 'w+b')
f = open('myfile', '+')
f = open('myfile', 'a')
After typing the ls –F command, you notice a filename that ends with an * (asterisk)character. What does this mean?a. It is a hidden file.b. It is a linked file.c. It is a special device file.d. It is an executable file.
After typing the ls –a command, you notice that there is a file whose filename beginswith a dot ( . ). What does this mean?a. It is a binary file.b. It is a system file.c. It is a file in the current directory.d. It is a hidden file.
Chapter 6 Solutions
Starting Out with Python (4th Edition)
Ch. 6.1 - What is an output file?Ch. 6.1 - What is an input file?Ch. 6.1 - What three steps must be taken by a program when...Ch. 6.1 - Prob. 4CPCh. 6.1 - Prob. 5CPCh. 6.1 - When writing a program that performs an operation...Ch. 6.1 - If a file already exists, what happens to it if...Ch. 6.1 - What is the purpose of opening a file?Ch. 6.1 - What is the purpose of closing a file?Ch. 6.1 - Prob. 10CP
Ch. 6.1 - In what mode do you open a file if you want to...Ch. 6.2 - Write a short program that uses a for loop to...Ch. 6.2 - Prob. 13CPCh. 6.2 - Assume the file data.txt exists and contains...Ch. 6.2 - Prob. 15CPCh. 6.3 - Prob. 16CPCh. 6.3 - Prob. 17CPCh. 6.3 - Prob. 18CPCh. 6.4 - Prob. 19CPCh. 6.4 - Prob. 20CPCh. 6.4 - What type of exception does a program raise when...Ch. 6.4 - Prob. 22CPCh. 6 - A file that data is written to is known as...Ch. 6 - A file that data is written to is known as...Ch. 6 - Before a file can be used by a program, it must be...Ch. 6 - When a program is finished using a file, it should...Ch. 6 - The contents of this type of file can be viewed in...Ch. 6 - This type of file contains data that has not been...Ch. 6 - When working with this type of file, you access...Ch. 6 - When working with this type of file, you can jump...Ch. 6 - This is a small holding section" in memory that...Ch. 6 - This marks the location of the next item that will...Ch. 6 - When a file is opened in this mode, data will be...Ch. 6 - This is a single piece of data within a record. a....Ch. 6 - Prob. 13MCCh. 6 - Prob. 14MCCh. 6 - Prob. 15MCCh. 6 - When working with a sequential access file, you...Ch. 6 - When you open a file that file already exists on...Ch. 6 - The process of opening a file is only necessary...Ch. 6 - Prob. 4TFCh. 6 - When a file that already exists is opened in...Ch. 6 - Prob. 6TFCh. 6 - You can have more than one except clause in a...Ch. 6 - Prob. 8TFCh. 6 - Prob. 9TFCh. 6 - Describe the three steps that must be taken when a...Ch. 6 - Why should a program close a file when it's...Ch. 6 - What is a read position? where is the read...Ch. 6 - If an existing file is opened in append mode, What...Ch. 6 - If a file does not exist and a program attempts to...Ch. 6 - Write a program that opens an output file with the...Ch. 6 - Write a program that opens the my_name.txt file...Ch. 6 - Write code that does the following: opens an...Ch. 6 - Prob. 4AWCh. 6 - Modify the code that you wrote in problem 4 so it...Ch. 6 - Write code that opens an output file with the...Ch. 6 - A file exists on the disk named students. txt. The...Ch. 6 - A file exists on the disk named students txt. The...Ch. 6 - Prob. 9AWCh. 6 - Prob. 10AWCh. 6 - File Display Assume a file containing a series of...Ch. 6 - File Head Display Write a program that asks the...Ch. 6 - Line Numbers Write a program that asks the user...Ch. 6 - Item Counter Assume a file containing a series of...Ch. 6 - Sum of Numbers Assume a file containing a series...Ch. 6 - Average of Numbers Assume a file containing a...Ch. 6 - Random Number File Writer Write a program that...Ch. 6 - Random Number File Reader This exercise assumes...Ch. 6 - Prob. 9PECh. 6 - Golf Scores The Springfork Amateur Golf Club has a...Ch. 6 - Personal Web Page Generator Write a program that...Ch. 6 - Average Steps Taken A Personal Fitness Tracker is...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Repair Bill Suppose automobile repair customers are billed at the rate of per hour for labor. Also, suppose co...
Introduction To Programming Using Visual Basic (11th Edition)
Why is it useful for a programmer to have some background in language design, even though he or she may never a...
Concepts of Programming Languages (11th Edition)
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
Under what circumstances does an object become a candidate for garbage collection?
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
How are documentation comments different from other types of comments?
Starting Out with Java: Early Objects (6th Edition)
A program that uses a multiple-level menu displays _____ when it starts. a. a warning to the user b. the main m...
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Which of the following opens the employ.txt file and allows the computer to write new data to the end of the files existing data? a. outFile = I0.File.AddText("employ.txt") b. outFile = I0.File.AppendText("employ.txt") c. outFile = I0.File.InsertText("employ.txt") d. outFile = I0.File.WriteText("employ.txt")arrow_forwardWhich of the following opens the employ.txt file and allows the computer to write new data to the end of the file’s existing data? a. outFile = IO.File.AddText("employ.txt") b. outFile = IO.File.AppendText("employ.txt") c. outFile = IO.File.InsertText("employ.txt") d. outFile = IO.File.WriteText("employ.txt")arrow_forwardA user types in the command head /poems/mary. What will be displayed on theterminal screen?a. the first line of the file maryb. the header for the file maryc. the first 20 lines of the file maryd. the last 10 lines of the file marye. the first 10 lines of the file maryarrow_forward
- The tac command _________________ .a. is not a valid Linux commandb. displays the contents of hidden filesc. displays the contents of a file in reverse order, last word on the line first and firstword on the line lastd. displays the contents of a file in reverse order, last line first and first line lastarrow_forwardWhich of the following operations should only be allowed to be done when the CPU is in kernel mode? Group of answer choices 1) Read data from a file 2) Open a file for reading, writing, or both 3) Set the time-of-day clock 4) Read the time-of-day clock A programmer opened a file using the file descriptor fd. The file contains the following sequence of bytes: 12, 14, 33, 33, 33, 12, 14, 1, 6, 33, 12, 14, 1, 6, 12 The programmer then uses these two system calls: lseek(fd, 3, SEEK_SET); read(fd, &buffer, 4); note, the lseek call makes a seek to byte 3 of the file. What does buffer contain after the read system call completes? Group of answer choices 1) 33 33 33 12 2) 33 33 12 14 3) 33 12 14 1 4) 33 12 14 In a uniprocessor system, multiprogramming increases processor efficiency by: Group of answer choices 1) All of the above 2) Increasing processor speed 3) Eliminating all idle processor cycles 4) Taking advantage of time wasted by long wait…arrow_forward. Which of the following options can be used to read the first line of a text file "Myfile.txt"? a. myfile = open('Myfile.txt'); print(myfile.read(line)) b. myfile = open('Myfile.txt','r'); print(myfile.read(1)) c. myfile = open('Myfile.txt'); print(myfile.readline()) d. myfile = open('Myfile.txt'); print(myfile.readlines())arrow_forward
- Which statement creates an input file object named inData? Group of answer choices fstream inData; instream:inData; ifstream inData; inputfile.inDataarrow_forwardCreate a program named FileComparison that compares two files. First, use a text editor such as Notepad to save your favorite movie quote. Next, copy the file contents, and paste them into a word-processing program such as Word. Then, write the file-comparison application that displays the sizes of the two files as well as the ratio of their sizes to each other. To discover a files size, you can create a System. 10. Filelnfo object using statements such as the following, where FILE_NAME is a string that contains the name of the file, and size has been declared as an integer: FileInfo fileInfo = new FileInfo(FILE_NAME); size = fileInfo.Length;arrow_forwardIn question 4 above, your friend is having problems finding the bootmgr file and asks for your help. What is your best response? a. Use diskpart commands to “unhide” and locate the file. b. Use the File Explorer options applet to unhide the hidden bootmgr file. c. Explain to your friend that performing a startup repair is a better option. d. Explain to your friend that he can use the bootrec command to fix the bootmgr file without having to copy another file to the computer.arrow_forward
- Several questions regarding the commands and shell programming a) list all files that the name starts/contains with ‘exam’. b) how to get the line count of a file? c) read/write files d) append directory the PATH environment variablearrow_forwardWhich class is not used in file handling?Single choice. Scanner None of these Buffered Reader FileinputStreamarrow_forwardAssume the following files are in the working directory: $ ls output.txt notes1 notes2 notestxt notes3 notes4 output.1 output.2 output.3 output-1b output-2b Give commands for each of the following, using wildcards to express filenames with as few characters as possible. a. List all files that begin with output. b. List all files that end in txt. c. List the output. files only. d. List the output.1, output.3, notes1, and notes3 files.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,A+ Guide To It Technical SupportComputer ScienceISBN:9780357108291Author:ANDREWS, Jean.Publisher:Cengage,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
- LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.Computer ScienceISBN:9781337569798Author:ECKERTPublisher:CENGAGE L
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
A+ Guide To It Technical Support
Computer Science
ISBN:9780357108291
Author:ANDREWS, Jean.
Publisher:Cengage,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:9781337569798
Author:ECKERT
Publisher:CENGAGE L
Linux - Tutorial for Beginners in 13 MINUTES! [ UPDATED ]; Author: bai;https://www.youtube.com/watch?v=BMGixkvJ-6w;License: Standard YouTube License, CC-BY
What is Linux?; Author: Techquickie;https://www.youtube.com/watch?v=zA3vmx0GaO8;License: Standard YouTube License, CC-BY
Introduction to Linux and Basic Linux Commands for Beginners; Author: sakitech;https://www.youtube.com/watch?v=IVquJh3DXUA;License: Standard Youtube License