Parenthesis - Dumb question


Ok, So I am really confused. I used the pycharm program to start fooling around with programming. The thing is. The first thing I tried to do was hello world and it is different than what is being taught in code academy.

I tried the following code as taught in codeacademy

Print "hello world" (this resulted in a syntax error.)

The correct version for pycharm is
print ('hello world')

This may seem nit picky but what are we not being taught to use parenthesis the correct way? Why is code academy code different than real world. I would love a good explanation here. I cant imagine a good reason why this is different.


In Python 2, print is a construct, whereas in Python 3 it is a function. We invoke a function with ().

When the course was written, Python 3 was gaining traction but the powers that be at CC must have opted to introduce Python 2 since it is the core language. Learning both is still the way to go in the long run.


Wow, thank you for the quick response. Further dumb questions. I am assuming code academy is then teaching in 2 versus 3.


Apparently Python 3 has been around since Feb 2009. Was Codecademy's Python course created before then? I find this unusual, too.


Learning Python 3 out of the box prevents us from recognizing Python 2 code when we are reading old code. There are several differences that should be learned. I'm of the opinion that Python 2 should be taught first.


    print  versus  print()

is just one of the differences.

    raw_input()  vs.  input()

range returning a list vs. returning an iterator.

Same applies to map().


Isn't the course getting updated sometime this summer?


It may well be, and the new material may be Python 3, but it doesn't remove the need to know Python 2, at least in terms of the differences.


Well of course, I don't know if I would be able to understand Python 3 as well as I do without having first learned JavaScript and then Python 2.7.



Following is an article from last year...


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