生成器表达式

g = (i for i in range(10))
print(g)
for i in g:
    print(i)

 

posted @ 2018-10-13 16:49  钟馗君  阅读(81)  评论(0)    收藏  举报