Answer to Question #231120 in Python for Rachna Pal

Question #231120

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.


1
Expert's answer
2021-09-01T02:35:56-0400
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)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS