python生成器学习: 案例分析一: def demo(): for i in range(4): yield i g=demo() g1=(i for i in g) #(i for i in demo()) g2=(i for i in g1) #(i for i in (i for i in demo())) ---> print(list(g1)) #list((i for i in demo())) #执行后 list((0,1,2,3)) --->[0,1,2,3] print(…