Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

slove with python 3 frineds are the numbers for example, 1 is friend with 0,3,4,6,7 2 is friend with 0, 3, 6, 8, 9 100

slove with python 3

frineds are the numbers for example, 1 is friend with 0,3,4,6,7

2 is friend with 0, 3, 6, 8, 9

100 means 1 has two friends 0 and 0

def people_with_most_friends(network): '''(2Dlist)->1D list Given a 2D-list for friendship network, returns a list of people (IDs) who have the most friends in network.''' max_friends=[] # YOUR CODE GOES HERE return max_friends

run:

>>> people_with_most_friends(net1)

[1, 2, 8]

>>> people_with_most_friends(net2)

[0]

>>> people_with_most_friends(net3)

[0]

>>> people_with_most_friends(net4)

[0]

note net1.txt contains: 100 10 20 31 41 61 71 92 32 62 82 93 83 94 64 74 58 96 87 8

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_2

Step: 3

blur-text-image_3

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

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago

Question

d. How will lack of trust be handled?

Answered: 1 week ago

Question

b. Does senior management trust the team?

Answered: 1 week ago