Python学习笔记 - 生成器generator
#!/usr/bin/env python3# -*- coding: utf-8 -*-# generator 生成器L = [x * x for x in range(10)]print(L)# [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]g = (x * x for x in range(10))print(g)# at 0x00000000