Discuss / Python / 提问

提问

Topic source

n = 0 for t in triangles(): print(t) n = n + 1 if n == 10: break

这段输出的循环中 ‘for t in triangles():’ 循环的是什么?

明白了,是用for调用生成器


  • 1

Reply