用来创建list的方式。
a = [i for i in rang(1,11)]
返回[1,2,3,4,5,6,78,9,10]
b = [i*i for i in rang(1,3)]
返回[1,4]
[i+j for i in 'a,b,c' j for j in 'x,y,z']
返回['ax','by','cz']
用来创建list的方式。
a = [i for i in rang(1,11)]
返回[1,2,3,4,5,6,78,9,10]
b = [i*i for i in rang(1,3)]
返回[1,4]
[i+j for i in 'a,b,c' j for j in 'x,y,z']
返回['ax','by','cz']