Question: File name customers _ data and value new _ customer are read from input. Perform the following tasks: Open the file customers _ data with

File name customers_data and value new_customer are read from input. Perform the following tasks:
Open the file customers_data with the 'at' update mode for reading and appending at the same time. Assign customers_file
with the opened file.
Write new_customer to customers_file without overwriting any existing contents.
Call customers_file's flush().
Click here for example
Note: The challenge activity will read and output the file named customers_data.
customers_data = input ()
new_customer = input ()
''' Your code goes here '''
# When a file is in update mode,
# seek (0,0) rewinds the file to enable reading from the beginning
customers_file.seek (0,0)
file_data = customers_file.read ()
print(file_data)
customers_file.close()
 File name customers_data and value new_customer are read from input. Perform

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!