The newest version of our Introduction to Python course teaches students the basics using Python 3, instead of Python 2.
After the 2020-21 school year, we updated all videos, quizzes, examples, and exercises to teach and run Python 3, so you can teach your students the most up-to-date version of the language. You can learn more about our Python curriculum in this article, or in our course catalog.
Please note: the Python 2 version of this course was available until the end of the 2019-20 school year for students.
What are the differences between Python 2 and Python 3?
Within the CodeHS curriculum, the differences between Python 2 and 3 are minimal:
Print is now called as a function, with parentheses:
(print('hello'))
Division now returns a float by default. You can make it behave like Python 2 with
// (i.e. 1 // 2)
xrange
no longer exists, so you can just use rangedict.iteritems()
is nowdict.items()
Still have questions? Contact our team at hello@codehs.com to learn more!