View Single Post
# 3 27-07-2021, 06:38 AM
warnerarc
Registered User
Join Date: Jul 2021
Posts: 1
Its because in Python 3, print statement has been replaced with a print() function, with keyword arguments to replace most of the special syntax of the old print statement. But if you write this in a program and someone using Python 2.x tries to run it, they will get an error. To avoid this, it is a good practice to import print function:

from __future__ import print_function

Now your code works on both python2 and python3