<reponame>t4d-classes/advanced-python_05242021<gh_stars>1-10

from collections.abc import Generator

def do_it() -> Generator[int, str, None]:

    result = yield 1
    print(result)

    result = yield 2
    print(result)

    yield 3


gen = do_it()
print(next(gen))
print(gen.send('a'))
print(gen.send('b'))


from collections.abc import Generator

def do_it() -> Generator[int, str, None]:

    result = yield 1
    print(result)

    result = yield 2
    print(result)

    yield 3


gen = do_it()
print(next(gen))
print(gen.send('a'))
print(gen.send('b'))