标签: python for-loop scope list-comprehension python-2.x
此代码:for i in range(5): m = [i for i in [1,2,3,4]]; print(i)
for i in range(5): m = [i for i in [1,2,3,4]]; print(i)
在Python2.7中打印:4 4 4 4 4
4 4 4 4 4
在Python3.6中打印:0 1 2 3 4
0 1 2 3 4
这是一个错误吗?