Write a function TRANSFER( ) in PYTHON, that would copy all those records which are having area code as “DEL” from PHONE file to PHONBACK file.
def transfer():
files = open(PHONE.txt, 'r')
file2 = open(PHONBACK.txt, 'r')
file1 = files.readlines
for lines in file1:
if 'DEL' in lines.split():
file2.append(lines)
Comments
Leave a comment