function writes the sorted information into "out.txt" as follows: ===== out.txt ===== 12345678901 Burkay Genç 0555-999-99-99 12345678902 Ahmet Kaya 0555-999-99-88 12345678903 Erkin Koray 0555-999-99-77 12345678904 Barış Manço 0555-999-99-66 ================== You can assume that TCNO and the phone number will be provided as a block, without any spaces. You can also assume that the persons have just one name. Note that inFilename and outFilename are the names of arguments of the function. They are strings, and the values of the strings are the actual file names. For example, if the function is called such as: readText("file1.txt", "file2.txt") then, you must read the content from "file1.txt" and write the output to "file2.txt". """ def readText(inFilename,outFilename):

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Question 5:  Complete the below function that takes the name of two files, inFilename and outFilename as arguments and reads the text from the inFilename. In this file each line contains the Turkish Republic Identity Number (TCNO), name, surname and telephone number of a person. Your function should sort all persons according to their TCNO, write the sorted data into outFilename. If the file inFilename does not exist, then the function must create an empty file named outFilename. For example, if the function is called such as readText("in.txt", "out.txt") and in.txt is as follows: ===== in.txt ===== 12345678904 Barış Manço 0555-999-99-66 12345678902 Ahmet Kaya 0555-999-99-88 12345678901 Burkay Genç 0555-999-99-99 12345678903 Erkin Koray 0555-999-99-77 ================== Then, the function writes the sorted information into "out.txt" as follows: ===== out.txt ===== 12345678901 Burkay Genç 0555-999-99-99 12345678902 Ahmet Kaya 0555-999-99-88 12345678903 Erkin Koray 0555-999-99-77 12345678904 Barış Manço 0555-999-99-66 ================== You can assume that TCNO and the phone number will be provided as a block, without any spaces. You can also assume that the persons have just one name. Note that inFilename and outFilename are the names of arguments of the function. They are strings, and the values of the strings are the actual file names. For example, if the function is called such as: readText("file1.txt", "file2.txt") then, you must read the content from "file1.txt" and write the output to "file2.txt". """ def readText(inFilename,outFilename):

Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY