88一行代码有误,结果多另一个空list,可以更改为:
wangzaistone opened this issue · 0 comments
wangzaistone commented
原代码与结果为:
N =100
print ([[x for x in range(1,100)] [i:i+3] for i in range(0,100,3)])
[[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12],... [97, 98, 99], []]
=100
可以更改为:
s=[[ m for m in range(j+1,j+4)] for j in [ i for i in range(0,97,3)]]
print(s)