Python 2.7.3 or 3.4.1?

  • Python
  • Thread starter Cake
  • Start date
  • #1
100
16

Main Question or Discussion Point

I have a book for learning python that teaches it with python3 in mind. I also have been using codecademy.com to learn in a more structured way. The thing is that codecademy teaches python from when the most recent form of python was 2.7.3. Their reasoning behind this is that python3 isn't very backwards compatible so they're teaching 2.7.3 for now. If you were learning python for physics and mathematics programming, which version would you learn?
 

Answers and Replies

  • #3
MarneMath
Education Advisor
549
198
Either way you'll be fine. The main purpose of initially learning how to code is to learn how python works. At the most basic level, python 2.7 and python 3 will work the same. If you want to be extra clever, you can follow the python 2.7 lessons and do it python 3. Thus teaching yourself the difference. However, as someone who knew python 2.7, teaching myself python 3 took a day at basic principles. A bit longer to get used to smaller modules, but the built in STAT modulo was nice.
 
  • #4
1,065
53
Yes, for a long time now, everybody keeps talking of waiting for the move until all scientific modules have been ported over to 3...but you don't need them all, just check to see which ones you need and if those have already been ported over or not.

Lately, I learned of the Anaconda Python distribution...I liked it and install it; from the documentation, one can tell that it is fairly easy to switch between running 2.7 and 3.4 using conda.
 
  • #5
TheDemx27
Gold Member
170
13
I would learn 2.7 just because there are a lot more useful libraries for it so far. I don't know how many times I started writing a program in 3.4.2 and then I had to convert the whole thing back to 2.7 just because there weren't any libraries to do what I wanted. Unless you are either going to be using really standard libraries without getting too technical, or you are up to writing whole new libraries for 3.4.2 (which you aren't since you are just starting out), I would recommend 2.7.
 
  • #6
90
19
If you need 2.x for compatibility with libraries, use that. Otherwise use 3.x.
 

Related Threads on Python 2.7.3 or 3.4.1?

Replies
14
Views
1K
  • Last Post
Replies
20
Views
32K
Replies
26
Views
8K
  • Last Post
Replies
3
Views
2K
Replies
2
Views
327
Replies
9
Views
916
Replies
6
Views
4K
  • Last Post
Replies
4
Views
867
  • Last Post
Replies
7
Views
813
Replies
2
Views
1K
Top