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
Go to list of users who liked
More than 1 year has passed since last update.
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
Register as a new user and use Qiita more conveniently
Go to list of users who liked