Is it print("") or print in python?


#1

I’ve been practicing Python here in Codecademy and they’ve been using print “string” to print strings in the console, but now that I went to use another python IDE it tells me the right syntaxis is print(""). Now I’m worried that Codecademy’s python course isn’t accurate after all. Please help


#2

For the present we are working with Python 2, in which print is a construct, not a function. Python 3 expects print() which is a function. There is one consolation in that we can use parens in Python 2 so get to build a habit now that can apply to both versions.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.