列表推导式 egg_list=['鸡蛋%s'%i for i in range(10)] print(egg_list) 列表推导式 推导过程 egg_list = [] for i in range(10): egg_list.append('鸡蛋%s'%i) print(egg_list) print([i*i for i in range(10)]) for循环 生成器表达式 g = (i for i in range(10)) print(g) for i in g: print(i)…