1.21 Python2下 也能使用 print(“”) ================================= .. image:: http://image.iswbm.com/20200804124133.png 可能会有不少人,觉得只有 Python 3 才可以使用 print(),而 Python 2 只能使用\ ``print ""``\ 。 但是其实并不是这样的。 在Python 2.6之前,只支持 .. code:: python print "hello" 在Python 2.6和2.7中,可以支持如下三种 .. code:: python print "hello" print("hello") print ("hello") 在Python3.x中,可以支持如下两种 .. code:: python print("hello") print ("hello") 虽然 在 Python 2.6+ 可以和 Python3.x+ 一样,像函数一样去调用 print ,但是这仅用于两个 python 版本之间的代码兼容,并不是说在 python2.6+下使用 print() 后,就成了函数。