生成器表达式: #列表推导式 # y = [1,2,3,4,5,6,7,8] # x = [1,4,9,16,25,36,49,64] # x = [] # for i in y: # x.append(i*i) # print(x) # x = [i*i for i in y] # print(x) #range(100) # x2 = [i/2 for i in range(100)] # print(x2) #生成器表达式 # x = [i*i for i in y] # print(x)…