python 2.7 vs python 3+. Which one and why? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

python 2.7 vs python 3+. Which one and why?

I started learning python about 2 months ago. I started with python 3.6 but have learned that 2x runs at much faster rates than python 3. The mandatory parenthesis are a bit annoying and from what I know 2x doesn't require them. What is your favorite version and why.

15th Oct 2017, 4:27 AM
stephen barter
stephen barter - avatar
6 Answers
+ 5
3.6 without a second thought. I'm curious to know exactly how much faster 2.7 is over 3.6.3. https://wsvincent.com/python2-vs-python3/
15th Oct 2017, 5:28 AM
David Ashton
David Ashton - avatar
+ 5
If you upgrade to 3.6 you can use the handy f-string feature https://www.sololearn.com/Discuss/768904/?ref=app
15th Oct 2017, 3:29 PM
David Ashton
David Ashton - avatar
+ 4
I had a look at his book, which is current to Python 3.3. Here are a couple of quotes and a couple of other links. I find it a bit confusing, but I think the general wisdom today is go with 3.6. P. 1170: On some benchmarks, Python 3.3’s overall memory usage is 2 to 3 times smaller than 3.2, and similar to the less Unicode-centric 2.7. P. 662: In general, PyPy 1.9 (implementing Python 2.7) is typically faster than CPython 2.7, and CPython 2.7 is often faster than CPython 3.3. In most cases timed, PyPy is some 10X faster than CPython, and CPython 2.7 is often a small constant faster than CPython 3.3. In cases that use integer math, CPython 2.7 can be 10X faster than CPython 3.3, and PyPy can be 100X faster than 3.3. In other cases (e.g., string operations and file iterators), PyPy can be slower than CPython by 10X, though timeit and memory management differences may influence some results. https://www.google.ca/amp/s/www.infoworld.com/article/3149782/application-development/python-36-is-packed-with-goodness.amp.html https://mail.python.org/pipermail/speed/2016-November/000472.html
15th Oct 2017, 3:22 PM
David Ashton
David Ashton - avatar
+ 3
u know 3.6 thats it... go as the flow goes.. theres no versus applicable here.. 2 .* and 3 . * are upgrade.. 2 to 3 3.4-3.5-3.6 those are update of same version.. u know the latest... thats it...not a problem...
15th Oct 2017, 5:27 AM
sayan chandra
sayan chandra - avatar
+ 3
I think the issue was that they added some very powerful features in 3x that added functionality at the expense of performance. though as David said...they are catching up now. hard to keep up with this ever changing world of technology!! I'm learning this the hard way now attempting to use selenium with current versions of Firefox.. ugh. thanks for informative answer David.
15th Oct 2017, 4:10 PM
stephen barter
stephen barter - avatar
+ 2
I'm reading Mark Lutz : Learning Python and the bench mark tests between 3x and 2.7 are pretty significant. 2 .7 runs about 10x faster in most cases.
15th Oct 2017, 6:54 AM
stephen barter
stephen barter - avatar