Which version of Python made print a function (required parentheses)?

The story behind the answer

Python 3.0 made `print` a function, so printed values normally require parentheses. In Python 2, `print` was a statement, allowing syntax such as `print "Hello"`; Python 3 changed that to `print("Hello")`.

This was part of Python 3.0's deliberate, backward-incompatible cleanup. Released on December 3, 2008, Python 3 aimed to remove duplicate or inconsistent language features and make syntax more regular. Treating `print` as a function also enabled ordinary function features, including keyword arguments such as `sep` and `end`.

A common mix-up is Python 2.6 or 2.7: both can use `print()` in many cases, but their legacy print-statement syntax remains. They can also opt into Python 3-style behavior with `from __future__ import print_function`. Python 3.5 is simply a later release in the same Python 3 series.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: