Скачиваний:
2
Добавлен:
03.06.2024
Размер:
198 б
Скачать
def my_pow(n: int):
    while True:
        yield n
        n = pow(n, 2)

powe = my_pow(2)
for i in range(5):
    print(next(powe))

a = my_pow(2)
assert next(a) == 2
assert next(a) == 4
Соседние файлы в папке 6