Jump to content

Python 2 or 3?

Crunchy Dragon

Hello programmers!

 

I'm starting to get back into coding, after spending quite some time away. Around 10 years ago, I started learning a little bit of I would have to guess mid-Python 2, which has since vacated my memory. Recently, I used my 7-day free trial of CodeAcademy Pro to learn a bit of Python 3.

 

My trial has since run out, and Python 3 is now hidden behind a lovely paywall. However, Python 2 on CodeAcademy is free to learn.

 

My question is simply this, should I learn Python 2 or 3?

I've read a little bit about it here, but I'm still not 100% sure.

Quote or tag me( @Crunchy Dragon) if you want me to see your reply

If a post solved your problem/answered your question, please consider marking it as "solved"

Community Standards // Join Floatplane!

Link to comment
Share on other sites

Link to post
Share on other sites

The difference between python 2 and 3 are pretty small, so if you wanted to use code academy you could follow the python 2 course then just learn the few things that have changed (print became print(), 3 / 2 went from 1 to 1.5, and a few other minor changes).

I would recommend python 3, because python 2 will be end of life fairly soon.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

As far as I can tell, there are very few things that work in 2 that don't work in 3. However, there are many features of 3 that are simply not available in 2, like F-strings and more advanced list comprehensions.

The biggest differences that a "beginner" (not that you are one in the strictest sense) would notice is that division of integers now returns some type with a decimal instead of being truncated division, and the "print" statement has been updated to have the same syntax as all other builtin functions, "print()". Another feature that a beginner with experience in python 2 would notice is that there are now more string formatting options than the old C-like syntax.

In regards to the first change, truncated division is now done by using the "//" operator.

 

Unless you specifically want to use some outdated libraries that only work with 2.7, I would strongly recommend learning 3.7.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/6/2019 at 4:35 AM, Crunchy Dragon said:

My question is simply this, should I learn Python 2 or 3?

Write in C.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

  • 3 weeks later...
On 5/8/2019 at 9:34 AM, Dat Guy said:

Write in C.

write in python, complie to c

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×