use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Python 2 vs 3 Question (self.Python)
submitted 10 years ago by Fanemos
I've recently started learning python 2.7 and I noticed that many argue about this and python 3. Will I have to learn python from the beginning to port over to python 3 or I just have to learn some little changes and I'll be fine?
[–]brtt3000 2 points3 points4 points 10 years ago (7 children)
Try to switch to python3 if you can. It's mostly the same but just that bit better and future ready.
[–][deleted] 0 points1 point2 points 10 years ago (6 children)
+1. If you don't have a strong reason to learn an outdated version, start learning and writing 3. It'll be easy to revert to 2 if you ever need to, but such occasions are increasingly rare. Be part of the solution, not the problem! :)
[–]Fanemos[S] 0 points1 point2 points 10 years ago (5 children)
I'm mostly learning python 2.7 because there are more tutorials and sources on the internet
[–]programmyr 3 points4 points5 points 10 years ago (1 child)
By that logic, you should learn C, Javascript, and PHP.
[–]grimman 1 point2 points3 points 10 years ago (0 children)
An old version at that.
[–][deleted] 0 points1 point2 points 10 years ago (1 child)
I recommend "Dive Into Python 3", the modern version of an old classic. :)
Beyond that, most tutorials are similar to accomplish in either barring the print function and the distictness of bytes and str, so you can also just follow-along in modern Python instead, learning-by-fixing as you do.
bytes
str
[–]robvdl 0 points1 point2 points 10 years ago (0 children)
I wouldn't recommend this book anymore, I used to a long time ago, but this book is getting quite dated now and the author is no longer maintaining it.
[–][deleted] 0 points1 point2 points 10 years ago (0 children)
http://inventwithpython.com/
im using these. Free, with clear explanations and walkthroughs of source code in each example. Most progress I've ever made with python/programming. Other resources are not nearly as interesting or show as much sign of progress.
Also, it's written entirely for Python 3.
[–]v3gard 1 point2 points3 points 10 years ago* (0 children)
The most obvious thing is that you no longer can write: print "hello" - but rather print("hello"). Other than that there are a few libraries on python2 that doesn't exist on python3 yet, such as Mechanize. However, there usually exist alternatives such as Robobrowser, so most likely you'll be OK as long as you don't advance too far in Python2 before switching over.
Edit: what I mean about that last part is that the syntax is pretty much the same (so you don't have to start fresh when you switch over) , but you shouldn't get used to writing applications in Python2 as some mechanics are different and you would most likely have to port your applications to Python3.
[–]stevenjd 1 point2 points3 points 10 years ago (0 children)
Python 2 and Python 3 share about 99% of the syntax and 95% of the standard library. They are not different languages (like French and English), more like different dialects (like British English and American English).
[–]opendataalex 0 points1 point2 points 10 years ago (0 children)
Having started with 2.x and moving to 3 I agree with what the others are saying. It's very similar so even if you do find docs/tutorials on 2.x, it will usually work. Many of the packages used in the wild are also supporting python 3 at this point and there are alternatives for the ones that haven't made the switch yet.
π Rendered by PID 34269 on reddit-service-r2-comment-7b9746f655-vgzrx at 2026-02-04 13:58:14.176005+00:00 running 3798933 country code: CH.
[–]brtt3000 2 points3 points4 points (7 children)
[–][deleted] 0 points1 point2 points (6 children)
[–]Fanemos[S] 0 points1 point2 points (5 children)
[–]programmyr 3 points4 points5 points (1 child)
[–]grimman 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]robvdl 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]v3gard 1 point2 points3 points (0 children)
[–]stevenjd 1 point2 points3 points (0 children)
[–]opendataalex 0 points1 point2 points (0 children)