I am newbie on Python.
I run the following code on python 2.7 and I see different result when I use print or print(). What is the difference between these two functi
In the first example you're printing tuple, but not calling print function. So the following is identical:
a = ("box: ", box)
print a
In other words, in first example you've created a tuple and printed it. Different output, for different datatypes.
There's supposed to be no significant difference between function and statement for your case, but for sake of future I'm strongly advice you to always use function (print()
). However, if you're still interested in differences (not related to your case), with print function you can specify separator, end and where to output it as described in documentation.