a=range(100) b=(chr(x) for x in a) 小括号扩起来的就是生成器表达式,一次生成一个元素,而且使用完没办法重复使用 print([x for x in b]) 上面中括号扩起来的就是列表推导