Created
August 7, 2020 12:28
-
-
Save Toshakins/bcd69b3d8e938697859c0a5be863648e to your computer and use it in GitHub Desktop.
employeefication
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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