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