Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python3 Skills Needed to complete this Lab . Use sets .Reading a text file Social Network People have friends and connections on social media sites.

Python3 image text in transcribed
image text in transcribed
Skills Needed to complete this Lab . Use sets .Reading a text file Social Network People have friends and connections on social media sites. Many times those site show us things for friends of friends who we aren't directly connected to. You are given a text file (friends.txt') that contains rows of people who are connected as friends. Each line has 2 names separated by a space. For instance, line 1, is "Alice Bob" Which means alice is a friend of bob and bob is a friend of alice. The input file may contain different values. You can't assume you will have Alice, Bob, Carol, Edward, Daniel and Fran. You'll want a data structure to track all the friends and each one will have its own data structure for what friends they have. Sample Output Social Network I. Find all friends shared by 2 people D. Find all friends of x, that person Y does not have S. Find all friends that X and Y have, but do not share with each other Q. Quit Enter a valid personAlex Alex is not part of this network, enter another name. Enter a valid personAlice Enter a valid person >Fran Alice and Fran share these people Carol Bob Social Network I. Find all friends shared by 2 people D. Find all friends of X, that person Y does not have S. Find all friends that X and Y have, but do not share with each other Q. Quit Enter a valid person Enter a valid person Alice Fran These people are friends with Alice but not with Fran

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions

Question

=+5 How does HRM relate to efforts to increase innovation?

Answered: 1 week ago