Skip to content

Instantly share code, notes, and snippets.

@Toshakins
Created August 7, 2020 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Toshakins/bcd69b3d8e938697859c0a5be863648e to your computer and use it in GitHub Desktop.
Save Toshakins/bcd69b3d8e938697859c0a5be863648e to your computer and use it in GitHub Desktop.
employeefication
import random
from itertools import count, takewhile
names = ["Френк", "Клер", "Зоя", "Питер", "Лукас"]
def employee():
name = random.choice(names)
return name
# Менять можно только код ниже,
# функцию employee() не трогаем
def employeficator():
return takewhile(
lambda person: person != 'Френк', (employee() for _ in count()))
employees = [name for name in employeficator()]
print(employees)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment