Python 2 vs. Python 3: Which LPTHW book should I get?

I checked out both books, and I honestly… like the formatting of python 3 a lot better.

Plus a lot of my friends who are in the tech industry gear towards python 3, and it makes it a lot easier to read a lot of code that is on github.

just my two cents.

1 Like

Nice,… I’ve been away for a long time and I think is a great idea that @zedshaw come up with this forum idea which is an incentive to ‘keep on learning’ since I don’t feel we are no longer alone.

Anyway… I know that the importance of P2 is ‘backward compatibility’ but looking forward (since I’m not professionaly active on python at all) I’m getting all around P3.

Just sharing my thoughts on this…

1 Like

I haven’t tried python three formating, but not overly fussed, yes you can achieve things in two line that might take you three, however readability is reduced, certain amount of verbose is needed. It’s like going to a fine restaurant and ending up in a pool hall. I’m really only new so don’t take my word for being “the best option”.

But if you like music or poetry, than python 2 is like these python 3 is the daily news, boring even though it is dramatic.

2 Likes

I put a lot of work into the updating the Python 3 book so that it’s matching more what’s going on in Python these days, but without some of the dumber stuff I see them doing.

2 Likes

A huge reason why I purchased your book!

My friends have critiques (of course), but I find your style particularly captivating, and it allowed me to actually write an openfile.py program that impressed my friends.

They were like… F STRINGS!!! YOU GOT F STRINGS EVERYWHERE MAN :slight_smile:

1 Like

@ricarod What is DB? I am hours old in the coding world :stuck_out_tongue:

Data base.

I was referring to the part of coding that is not about making a program that makes calculation (like a function that return the area of a rectangle) but the ones that store records persistently like clients information, billing, etc.

You can then take that, put it on a web framework and have something to offer as a service

Eh I was wrong. Coding style doesn’t change much.

https://docs.python.org/3.0/whatsnew/3.0.html#text-vs-data-instead-of-unicode-vs-8-bit

I find that so bizarre. So, the Python 3 proponents will tell you to use Python 3 because it’s the future, but if you use the most recent version of Python and use the best feature of it (f-strings rock), then ohhhh nooooo that’s tooo much future good sir! We mean Python 3.5, but definitely because it’s the future, just not so much future as 3.6, because that’s so much future.

2 Likes

Dare I ask … Wtf are F Strings?

The Python 3 version of formatting strings. In Python 2 it was

print("{} bar".format("foo"))

Output: foo bar

In Python 3 you do

var = foo
print(f"{var} bar")

Output: foo bar

1 Like

A fine comprehensive overview of all of Pythons formatting options you can find here: https://pyformat.info/

For other cool links on Python topics you can see my Library in the Python category: My Python Library

1 Like

Hey, what is the difference between “Learn Python 3 the hard way” and “Learn MORE python 3 the hard way”???

Learn More Python doesn’t teach the basics of the language but instead teaches increasingly more advanced topics.

“Learn Python 3 the Hard Way” will get you excited to start building stuff in Python. “Learn More Python The Hard Way” will melt your brain.

In a good way.

1 Like

Oh… I see. Thanks @austen

Oh… Thank you @zedshaw

Zedshaw, I have finished your Learn python the hard way, now I want to complete my knowledge on this language. Please would you suggest which book to study now to complete my knowledge of python language??

Hey @Kabir I would suggest that you pick @zedshaw’s another book on Python: Learn More Python The Hard Way. It starts where LPTHW ends and is designed to get you started with real coding.

2 Likes