为什么在与推导过滤器一起使用时,反转此推导中的循环顺序会产生不同的结果?
print len([cell for row in cells for cell in row])
print len([cell for cell in row for row in cells])
print len([cell for row in cells for cell in row if cell.rect.collidepoint(pos)])
print len([cell for cell in row for row in cells if cell.rect.collidepoint(pos)])
印刷:
192
192
1
0