1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lynna [10]
3 years ago
15

Make a Backwards Phonebook from a Regular Phonebook

Computers and Technology
1 answer:
Dima020 [189]3 years ago
7 0

Answer:

Code in Python is given. Take note of the instruction in bold font

Explanation:

You will need to update the below two lines in your system based on the file path -

backward_phone_number('F:\\phone_number_input.txt','F:\\phone_number_output.txt')

def backward_phone_number(input_file,output_file):

   ph_num_dictionary={}

   entries=[]

   #########################################################

   with open(input_file,'r') as read_file:

       entries=read_file.readlines()[1:]

   for entry in entries:

       ph_num_name=entry.split()

       ph_number=ph_num_name[1].strip()

       name=ph_num_name[0].strip()

       if ph_num_dictionary.get(ph_number)==None:

           name_list=[name]

           ph_num_dictionary[ph_number]=name_list

       else:

           ph_num_dictionary.get(ph_number).append(name)

   #########################################################

   ph_num_dictionary = dict(sorted(ph_num_dictionary.items(),key=lambda pair:pair[0]))

   with open(output_file,'w+') as write_file:

       write_file.write('Telephone Number\tName\r\n')

       for num,name in ph_num_dictionary.items():

           if len(name)==1:

               write_file.write(num+'\t'+name[0]+'\r\n')

           else:

               name.sort()

               for person in name:

                   write_file.write(num + '\t' + person + '\r\n')

backward_phone_number('F:\\phone_number_input.txt','F:\\phone_number_output.txt')

You might be interested in
A point is named by a lowercase letter. <br> a. True<br> b. False
Alik [6]
That is B False m8 that means mate btw xD please say thank you :P
4 0
3 years ago
Read 2 more answers
What two names are given to the blinking vertical line?
Paha777 [63]

Answer:

<u>see </u><u>below</u><u>:</u>

Explanation:

One is (the cursor).

Whenever you see a flashing vertical line called-the cursor--you can start typing.Note that the mouse pointer is also called a cursor,but it is shaped differently.The keyboard cursor is also called the insertion point.

5 0
3 years ago
How do i fix my this??
maksim [4K]

get a new monitor u cant


6 0
3 years ago
Read 2 more answers
3. What are two reasons for versioning your still life project file? (1.0 points)
inna [77]

Answer:

The project file can be managed by making its multiple version due to the following reasons.

1. We can create multiple copies or version of the project to avoid any unfortunate circumstance such as Project file can be corrupted or can be deleted. In that case we can use the other version of that project file.

2. When we are working on some project, we are modifying the code or program to achieve our desired results. In this process we may forgot the changes that we have made while modification. If we does not obtain our desired results while modification that can lead to losing the original file. To reduce this type of risk we create multiple versions of project File.

3. We also create version of our project files on some internet drives as a backup. In case our computer has lost or operating system has been corrupted. A version of our project file is available on Internet drives such as Google drive or Drop box.

3 0
3 years ago
1.       An ________ works for a company to design, carry out, and solve its electronic equipment related problems.
sp2606 [1]
B. Electronics Engineer
7 0
2 years ago
Other questions:
  • Why does the hp computer not have Bluetooth?
    6·1 answer
  • You are training to complete in a local 5K run. You record your time scores in minutes after completing seven practice runs. Wri
    5·1 answer
  • Why is it important to protect people's intellectual property online?
    10·1 answer
  • Anyone here good with python coding. I have some machine learning homework which I am having a hard time with,
    12·1 answer
  • I am buying a BluRay drive access time is 180ms and the other is 210ms(BD-ROM) whats does access time mean
    5·1 answer
  • In the RSA system, the receiver does as follows:1. Randomly select two large prime numbers p and q, which always must bekept sec
    6·1 answer
  • When your grounded and the only thing you can get on is a computer........................oh welllllllllllllllllllllllllllllllll
    7·1 answer
  • Which of these are examples of an access control system? Check all that apply.
    7·1 answer
  • Write a function DrivingCost with input parameters drivenMiles, milesPerGallon, and dollarsPerGallon, that returns the dollar co
    8·1 answer
  • Select all the correct answers.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!