Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What version of Python should I use if I'm a new to Python?

Tags:

If I'm absolutely new to Python and am literally reading about printing statements to console, variable types, collections, etc:

What version of Python should I use?

I'm aware that there is an abundance of 3rd party libraries for Python 2.6.x, but I'm scared I'll learn some things that won't carry over well into Python 3.

For example, in Python 3 you can use input(), in Python 2 you have to use raw_input().

Thank you very much for the information.

like image 284
Sergio Tapia Avatar asked Jan 19 '10 03:01

Sergio Tapia


2 Answers

Python 2.6 (and 2.5, 2.4) are what you will find installed on most machines (Linux) and what you will find most code written in. Therefore I'd start with Python 2.6.

like image 53
Ben Edwards Avatar answered Oct 21 '22 07:10

Ben Edwards


It's really going to depend on what you want to do. Generally speaking Python 3 "isn't ready yet", in the sense that few libraries support Python 3. This will end up greatly limiting what you can accomplish with the language as a beginner.

On the other hand, if you think you'll be spending your time on more "pure programming" tasks as you learn your way around, then Python 3 can be a good starting point, since things like strings are wildly different in Python 3.

So, what do you want out of Python right now? Do you want to make useful things? Python 2.x. Do you want to learn about Python for the sake of learning about Python? Python 3.

Here in a year or two, Python 3 will likely start being the default choice. Until then, it's really up to you. But you can be certain that whatever skills in Python you pick up are going to be useful in 2.x and 3. Some important things changed in Python 3, but Python 3 is still Python.

like image 36
Travis Bradshaw Avatar answered Oct 21 '22 07:10

Travis Bradshaw