Printing in Python 2.7 versus Python 3

In Python 2, it is a special statement and Python 3, print is a function.

Python

print “tj”

The output is

tj

Now in Python 3, you have to use parentheses and have quotation in side.

An example of Python 3 is,

print (“tj is awesome”)

The output is ,

tj is awesome

 

Links to some more awesome information

https://docs.python.org/3/whatsnew/3.0.html

 

Leave a Reply

Your email address will not be published. Required fields are marked *