Код: Выделить всё
def add_ints(x: int, y: int) -> int:
return x + y
Код: Выделить всё
def myfunc(x: [int]) -> "generator that returns ints":
# ^~~~~~~~~~~~~~~~~~~~~~~~~~
return (n for n in x if n % 2 == 0)
Подробнее здесь: https://stackoverflow.com/questions/272 ... n-python-3
Мобильная версия