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
This in mainly a complement to other answers.
You can see in Python 2 scripts print (var) when the normal usage would be print var.
It uses the fact that (var) is just a parenthesed expression in Python 2 with is simply seen as var so print(var) and print var behaves exactly the same in Python 2 - but only works when printing one single variable
The interesting point is that when you considere a migration to Python 3, print(var) (here the call to function print) is already the correct syntax.
TL/DR: print(var) in Python 2 is just a trick to ease Python3 migration using the fact that (var) is just an expression - the tuple form would be (var,)