Skip to content

Instantly share code, notes, and snippets.

@pavelch
Created May 16, 2017 11:22
Show Gist options
  • Save pavelch/964cc2ab27e8f214dd7dc79f07a52fac to your computer and use it in GitHub Desktop.
Save pavelch/964cc2ab27e8f214dd7dc79f07a52fac to your computer and use it in GitHub Desktop.
python famous test
def knows(person1, person2):
#if person1 knows person2
return True
def famous(persons):
famous = []
for person in persons:
if all(map(lambda x: knows(x, person), persons)) and not all(map(lambda x: knows(person, x), persons)):
famous.add(person)
return famous
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment