0
0

More than 1 year has passed since last update.

ジェネレータ メモ

Last updated at Posted at 2022-02-08
def test():
    yield [1,2,34] # ここで一時停止
    print('aaaa')  # 2回目のnext実行中に出力される


def test2():
    gen = test()
    print(next(gen)) # [1,2,34]
    print(next(gen)) # 'aaaa'
[1, 2, 34]
aaaa
StopIteration

0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0