异曲同工方法
三种同样道理的写法
1 print [x*(x+1) for x in range(1, 100, 2)]
2 print [x*(x+1) for x in range(1, 100)[::2]]
3 print [x*y for x,y in zip(range(1, 100, 2), range(2, 101, 2))]
三种同样道理的写法
1 print [x*(x+1) for x in range(1, 100, 2)]
2 print [x*(x+1) for x in range(1, 100)[::2]]
3 print [x*y for x,y in zip(range(1, 100, 2), range(2, 101, 2))]
2020-04-17
举报