What is the reasoning behind return in generatorfunctions?

前端 未结 0 609
暗喜
暗喜 2020-12-11 18:26

Take the following example:

def test():
  return "test"
  yield "yield"

for x in test():
  print(x)

print(next(test()))

相关标签:
回答
  • 消灭零回复
提交回复
热议问题