Question: I need a python script of this question, using the set() function and please as simple as possible. Thanks for your time! In your class,

 I need a python script of this question, using the set()
I need a python script of this question, using the set() function and please as simple as possible. Thanks for your time!

In your class, many students are friends. Let's assume that two students sharing a friend must be friends themselves; in other words, if students 0 and 1 are friends and students l and 2 are friends, then students 0 and 2 must be friends. Using this rule, we can partition the students into circles of friends. To do this, implement a function networksO that takes two input arguments. The first is the number n of students in the class. We assume students are identified using integers0 through n-1. The second input argument is a list of tuple objects that define friends. For example, tuple (0, 2) defines students 0 and 2 as friends. Function networks(0 should print the partition of students into circles of friends as illustrated: networks(5, [(0, 1), (1, 2), (3, 4)]) Social network 0 is (0, 1,2 Social network 1 is 3,4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!