0

Why do I have to do it like: print ('Hello') and not: print "hello"??

13th Jun 2017, 3:53 PM
Trym Tøfte
3 ответов
+ 4
cause in python3 parenthesis are must
13th Jun 2017, 4:03 PM
Sun
Sun - avatar
+ 2
You are calling a function called print, so you need to show what you are passing as the parameters with the parenthesis.
13th Jun 2017, 5:01 PM
Rrestoring faith
Rrestoring faith - avatar
0
That is actually one of the biggest differences between python 2 and python 3. Or, at least, the one people encounter most often :) In python 2, "print" was a statement. In python 3, it is a function. And a function is always called by using parentheses. https://docs.python.org/3/whatsnew/3.0.html
13th Jun 2017, 8:31 PM
Bogdan Sass
Bogdan Sass - avatar