Question: 2. Write a function file_copy() that takes two string parameters: in file and out_file and copies the contents of in_file into out file. Assume that

 2. Write a function file_copy() that takes two string parameters: in
file and out_file and copies the contents of in_file into out file.

2. Write a function file_copy() that takes two string parameters: in file and out_file and copies the contents of in_file into out file. Assume that in_file exists before file_copy is called. For example, the following would be correct input and output. 1 >>> file_copy( created equal.txt', 'copy.txt) 2 >>> open fopen ( copy.txt') 3 >>> equal-f = open( 'created-equal . txt') 4 >>equal_f.read () 5 'We hold these truths to be self-evident, Inthat all men are created equalIn' 3. Write: A program that implements a logbook, recording the visitors to a place of interest and their visit's purpose. This log book could later be read by another program. Implement a function called log that takes one parameter, filename, the name of a file. You may assume the file is in the current working directory of the program. log should prompt the user for their name and the nature of their visit. log should then append a line to the file named filename in the following format: | Additional requirements: If the user enters empty input, or input that is only whitespace, re-prompt them for valid input before continuing. Your program must not remove previous lines from the file. For example, assume the following is the current contents of a file log.txt: 1Winston Churchill | The Queen is expecting me

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!