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 customersdata and value newcustomer are read from input. Perform the following tasks:
Open the file customersdata with the at update mode for reading and appending at the same time. Assign customersfile
with the opened file.
Write newcustomer to customersfile without overwriting any existing contents.
Call customersfile's flush
Click here for example
Note: The challenge activity will read and output the file named customersdata.
customersdata input
newcustomer input
Your code goes here
# When a file is in update mode,
# seek rewinds the file to enable reading from the beginning
customersfile.seek
filedata customersfile.read
printfiledata
customersfile.close
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
