New visitors to Learn Python the Hard Way may be confused about whether they should read the Python 2 version or the Python 3 version of your book. What guidance can you provide to users with differing programming abilities?
I break it down like this:
If you just want to learn to code then it doesnāt matter. Pick whichever one is easiest to install.
- If you have a Mac then you already have Python 2 installed, so the Python 2 book is fine.
- If youāre on Windows then go with the Python 3 book as itās done entirely on a Windows 10 computer so itāll work great. The Python 3 book supports all three (Windows, MacOS, and Linux), but I made extra sure it worked on Windows.
If you want to get into Data Science, then Python 3 is used there, so get the Python 3 book.
Thanks for the question.
Theyāve said theyāll discontinue support many times and it never happens. Learn the python that you have.
I purchased Python 2 long time agoā¦ and very recently just got LMP3THW but the part that I am interested the most is DB which is not ready yet.
I wonder if after those purchase we could get some sort of super great loyalty discount and maybe I can get P3 as part of more practicing? Thatāll be niceā¦
Actually itāll be very nice if PYTHON 2 course (for those old timers here) can tell DEPRACATED in the content.
An example of this would be the āformmaterā part of printing in P2 since is now depracated in P3. Thatāll be at least helpful for old of us with access to old content here.
Rather than doing that I just wrote a Python 3 book. Despite what Python people say, there is still plenty of need for Python 2.
I think itās better to Learn python 3. OK, sure if you have Python 2 only learn it. But Python 3 has continued to develop as a language, with more features being added that improve the language. I think the weight of the python community has now tilted towards Python 3. Most of the interesting talks online are written around Python 3. I recommend Python 3. I donāt see why Iād use 2 any more. Well, OK, thereās stuff that only available in Python 2 because those things arenāt used that much, and are too hard to port. If you need to use Python 2, then do. But, if your 50/50, Iād go with Python 3 like most of the community.
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.
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ā¦
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.
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.
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
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.
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.
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
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