标签: python python-3.x python-2.7
为什么将print分配给foo时python 2代码抛出错误,而python 3却没有?
print
foo
Python 2
>>> foo = print File "<stdin>", line 1 foo = print ^ SyntaxError: invalid syntax
Python 3
>>> foo = print