subject

1 #Write a function called phonebook that takes two lists as 2 #input:
3 #
4 # - names, a list of names as strings
5 # - numbers, a list of phone numbers as strings
6 #
7 #phonebook() should take these two lists and create a
8 #dictionary that maps each name to its phone number. For
9 #example, the first name in names should become a key in
10 #the dictionary, and the first number in numbers should
11 #become the value corresponding to the first name. Then, it
12 #should return the dictionary that results.
13 #
14 #Hint: Because you're mapping the first name with the first
15 #number, the second name with the second number, etc., you do
16#not need two loops. For a similar exercise, check back on
17 #Coding Problem 4.3.3, the Scantron grading problem.
18 #
19 #You may assume that the two lists have the same number of #items: there will be no names without numbers or numbers
20 #without names.
21 #Write your function here!
25
26
27
28 #Below are some lines of code that will test your function
29 #You can change the value of the variable(s) to test your
30 #function wit h different inputs 2 If your function works correctly, this ill originally
31
32 #print (although the order of the keys may vary):
33| #('Jackie': '404-555-1234., 'Joshua': .678-555-5678., "Marguerite': '778-555-9012
35
36 name_list ['Jackie', Joshua', 'Marguerite']
37 number list-['484-555-1234, 678-555-5678 770-555-9812']
38 print (phonebook (name list, numberlist))
39
40
41

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
Suppose an astronomer discovers a large, spherical-shaped body orbiting the sun. the body is composed mostly of rock, and there are no other bodies sharing its orbit. what is the best way to categorize this body? a. planet b. moon c. comet d. asteroid
Answers: 1
question
Computers and Technology, 22.06.2019 22:00
Discuss the ways in which electronic information associated with payments is addressed in terms of security. include encryption, secure sockets layers, and secure electronic transactions in your discussion. are there any other ways that consumers and businesses can keep their payment information secure in an electronic commerce environment? do you feel that your information is safe when conducting electronic business? why or why not?
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
Jaina and tomas are being considered as new tenants in an apartment. the landlord looks at their creditworthiness because he wants to be sure his new tenant pays the rent on time and in full. the table below summarizes the information that was on their applications. application information questions jaina tomas how many years have you had your job? 5 2 what is your monthly salary? $1,850 $2,500 how many credit cards do you have? 4 1 how much debt do you have? $13,000 $7,000 how many times were you late with payments on credit cards in the past year? 5 1 who will the landlord decide to be more creditworthy and why? tomas because the ratio of his debt to income is less. jaina because she has had her job longer, which makes her look more stable. jaina because she has more credit cards available to her. tomas because he makes more money per month.
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
For her science class, elaine is creating a presentation on weather in the united states. she wants to make the presentation beautiful and interesting by drawing simple cloud or wave shapes. which is the best way for elaine to draw these shapes?
Answers: 1
You know the right answer?
1 #Write a function called phonebook that takes two lists as 2 #input:
3 #
4 # - name...
Questions
question
Biology, 24.08.2021 19:10
question
French, 24.08.2021 19:10
question
Mathematics, 24.08.2021 19:10
question
French, 24.08.2021 19:10
question
Mathematics, 24.08.2021 19:10
question
Mathematics, 24.08.2021 19:10