Welcome to the Treehouse Community
Looking to learn something new?
In Python track we should use Python 2x or 3x ?
I have watched already 2-3 videos and the teachers uses Python 3x I think, because of:
Is there big difference between those two version? Which is used more in production?
Chris FreemanTreehouse Moderator 67,989 Points
From this article on the key differences between Python 2.x and 3.x:
- The future module
- The print function
- Integer division
- Handling exceptions
- The next() function and .next() method
- For-loop variables and the global namespace leak
- Comparing unorderable types
- Parsing user inputs via input()
- Returning iterable objects instead of lists
input(), division "/", and steins behave different in Python 3:
A non-exhaustive list of features which are only available in 3.x releases and won't be backported to the 2.x series:
- strings are Unicode by default
- clean Unicode/bytes separation
- exception chaining
- function annotations
- syntax for keyword-only arguments
- extended tuple unpacking
- non-local variable declarations
This link lists what's new in each Python Release
All of the Treehouse code challenges expect Python 3 code. Workspaces also run Python 3.
It's better to work with Python 3 with Treehouse. After you become well versed in Python 3, learning how to convert to Python 2 and back is not difficult.
Zachary Kaufman1,463 Points
Python 2 would have print "Hello Python" so only small differences. https://wiki.python.org/moin/Python2orPython3#What_are_the_differences.3F that is the differences between them on the python wiki
Actually, they are pretty different in my opinion. Treehouse uses Python 3, and I mostly use Python 3 too.