1. Using python, create a program that uses a dictionary that performs contact tracing of persons. 2. The key is the person number and the values is a list of person numbers who are close contacts of this person. 3. The program inputs the person number and list of contacts for 3 persons. 4. Each person has 2 contacts. 5. This data is saved in a dictionary with the person numbers as keys, and the list of contacts as values. 6. The last input is the person number to query, and the program prints the list of close contacts. The program also prints the list of close contacts of those in close contact to the person queried. 7. The program prints 'No Contact' if there is no person record for a contact. 8. There is exactly 10 input integers and the input are all positive integers. 9. For this program, use python Dictionary get() Method. 10. Take a screenshot of your codes on your python complier and the expected output as well.

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
1. Using python, create a program that uses a dictionary that performs contact tracing of persons.
2. The key is the person number and the values is a list of person numbers who are close contacts of this
person.
3. The program inputs the person number and list of contacts for 3 persons.
4. Each person has 2 contacts.
5. This data is saved in a dictionary with the person numbers as keys, and the list of contacts as values.
6. The last input is the person number to query, and the program prints the list of close contacts. The
program also prints the list of close contacts of those in close contact to the person queried.
7. The program prints 'No Contact' if there is no person record for a contact.
8. There is exactly 10 input integers and the input are all positive integers.
9. For this program, use python Dictionary get() Method.
10. Take a screenshot of your codes on your python complier and the expected output as well.
SAMPLE INPUT 2
SAMPLE INPUT 1
# key person 1, person ID
# close contact of person e01
# close contact of person 001
# key person 2, person ID
# close contact of person 002
# close contact of person 002
# key person 3, person ID
# close contact of person 003
# close contact of person 003
# lookup close contacts of person 001
001
10
20
30
40
50
20
60
70
80
90
005
002
002
004
001
003
004
002
001
EXPECTED OUTPUT
EXPECTED OUTPUT
contacts of 001
[005, e02]
contacts of 005
No Contact
contacts of 9e
No Contact
contacts of 002
[004, 001]
Transcribed Image Text:1. Using python, create a program that uses a dictionary that performs contact tracing of persons. 2. The key is the person number and the values is a list of person numbers who are close contacts of this person. 3. The program inputs the person number and list of contacts for 3 persons. 4. Each person has 2 contacts. 5. This data is saved in a dictionary with the person numbers as keys, and the list of contacts as values. 6. The last input is the person number to query, and the program prints the list of close contacts. The program also prints the list of close contacts of those in close contact to the person queried. 7. The program prints 'No Contact' if there is no person record for a contact. 8. There is exactly 10 input integers and the input are all positive integers. 9. For this program, use python Dictionary get() Method. 10. Take a screenshot of your codes on your python complier and the expected output as well. SAMPLE INPUT 2 SAMPLE INPUT 1 # key person 1, person ID # close contact of person e01 # close contact of person 001 # key person 2, person ID # close contact of person 002 # close contact of person 002 # key person 3, person ID # close contact of person 003 # close contact of person 003 # lookup close contacts of person 001 001 10 20 30 40 50 20 60 70 80 90 005 002 002 004 001 003 004 002 001 EXPECTED OUTPUT EXPECTED OUTPUT contacts of 001 [005, e02] contacts of 005 No Contact contacts of 9e No Contact contacts of 002 [004, 001]
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 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