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 10:30
What can tanya do now to start preparing for the college and scholarship application process? think about her grades, activities in which she can get involved, possible part-time jobs at which she can work, and standardized tests she can take. (10 points) apex
Answers: 2
question
Computers and Technology, 23.06.2019 10:30
Would a ps4 wired controller work on an xbox one
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Whose task it is to ensure that the product flows logically from one step to another?
Answers: 3
question
Computers and Technology, 24.06.2019 01:00
What shows the web address of the page that is currently displayed in the workspace? status window toolbar location bar internet box
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
Business, 31.05.2021 02:50
question
Social Studies, 31.05.2021 02:50
question
Mathematics, 31.05.2021 02:50
question
History, 31.05.2021 02:50
Questions on the website: 13722362