Little late to ask but


What version of Python does codeacdemy teach?


The envrironment is 2.7.x. That doesn't mean it excludes 3.x.x, it's just not embedded in the environment. This is for good reason. As an introduction to Python the learner should be versed in the pre-version-three core and get to know its modules. This can take a long time so best it be from the starting gate, not thrust upon us half ways through a Python 3 course. There are differences, and it is best all around if the learner is fluent in both, but especially 2.x.x even if it is destined for mothballs in six years. 3.x.x is so much easier to adapt to with that under one's belt.

How does one spot Python 2.x.x code on first glance? Look for a raw_input(). Not found? If input() is found then it is a clue pointing to Python 3 If no inputs then look for a print statement. Is it written as a function call? That's a clue. Look for an iterable. Does it have a list() wrapper? Another clue. These are just some of the differences, There are many more.

What's nice is it doesn't stop us running Python 3 code in 2.x.x environment. The syntax hasn't changed. It's just more explicit than before. Depending on lesson expectations, version 3 code passes many lessons. Try to pass with both whenever you can.


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