G = (x*2 for x in range(4)) print(G) print(G.__next__()) print(next(G))#两种方法等价 # G每一次读取,指针都会下移 for x in G: print(x,end = " ")
2020-05-08
本文来自博客园,作者:CodeYaSuo,转载请注明原文链接:https://www.cnblogs.com/hany-postq473111315/p/12846945.html