生成器表达式

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

 

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