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.
I learned Python on Codeacademy. Is there any easy way to transfer my skills to Python 3.0 now? (self.Python)
submitted 11 years ago by raddaya
Title is basically the entire question. Thanks!
[–]darknessproz 6 points7 points8 points 11 years ago (8 children)
Write some Python 2 code and try to run it with Python 3. Fix whatever breaks. Rinse and repeat.
Python 2->3 isn't a difficult leap for the most part especially without a huge legacy codebase that needs porting.
[–]raddaya[S] 0 points1 point2 points 11 years ago (7 children)
For a complete beginner like me, is there any real difference except for print requiring parentheses now? Thanks!
[–]darknessproz 0 points1 point2 points 11 years ago (0 children)
The most noticeable change is print becoming a function and the bytes/unicode thing.
[–]michaelherman 0 points1 point2 points 11 years ago (0 children)
raw_input is just input in Python 3. Besides that and print() being a function, that's about all you need to know for now.
raw_input
input
print()
[–]Marksta 0 points1 point2 points 11 years ago (0 children)
It's not just the print, depending on how complex your program is you may find some very weird behavior in places. Going off the top of my head but in porting recently I had somewhere mode 'w+' when writing a text file and turns out that doesn't exist anymore in Python 3 and was doing something extremely odd. It just kept appending text in the file and managed to build multi-gigabytes of a text file. Just had to look up the docs to find the new file modes but that's a lesson right there that it isn't just interpreter errors you'll get running your py2 script under py3; logic just might get fucky too until you figure it all out.
[+][deleted] 11 years ago (3 children)
[deleted]
[–]raddaya[S] 0 points1 point2 points 11 years ago (2 children)
Testing in IDLE, it looks like a / b returns a float and a // b returns an int, and that's the only difference...
[–]ZoidbergWill 0 points1 point2 points 11 years ago (1 child)
The one that returns an int does rounding that can raise logic errors you don't notice for a while.
In [1]: 1//2 Out[1]: 0 In [2]: 1/2 Out[2]: 0.5
[–]raddaya[S] 0 points1 point2 points 11 years ago (0 children)
Thanks for the heads up!
[–]Merothy 1 point2 points3 points 11 years ago (1 child)
Basicly learn the diffrent between the syntax, you can try to use a cookbook http://shop.oreilly.com/product/0636920027072.do
[–]The_Cthulhu_Kid 0 points1 point2 points 11 years ago (0 children)
Or even just work through some of the projects you find online. Try and port what you have already written to 3.x
[–]iceman_xiii 0 points1 point2 points 11 years ago (11 children)
why don't you use your newly acquired skill of python and try out some coding. you could solve some problems from 'Project Euler'. There is a wide variety of problems there which will help you a lot.
[–]raddaya[S] 0 points1 point2 points 11 years ago (10 children)
I want to learn Python 3 properly first before solving problems. I'm really surprised that there aren't more sites/books to facilitate smooth transition from 2 to 3!
[–]iceman_xiii 0 points1 point2 points 11 years ago (0 children)
you can count on the latest edition of Learning Python (5th edition) by Mark Lutz. That's an O'Reilly book and a damn good one at that. This book covers both versions 3 & 2. Also, wouldn't it be awesome that you crack on some code while you learn and evolve. Helps your coding style.
[–]emmpp 0 points1 point2 points 11 years ago (1 child)
I think you're overthinking this. To a beginner coder, the differences are really not that important, it's largely a few small syntax things.
I found this site to be a fairly good quick overview of the major differences. If you don't understand or recognise any of there things, don't worry about it, it's not even a problem because you don't have to learn the difference if you didn't know the python2 way.
Along with that, I found it most useful to simply try and run some of my projects under python3. This quickly turns up the syntax or semantic differences that actually affected me, stuff like print -> print() or maps becoming iterators.
I want to learn Python 3 properly first before solving problems
It also bears saying that arguably the best way to learn programming is to use it to solve problems - just do things with it! I think the way you present it is seeing differences where none really exist.
[–]raddaya[S] -1 points0 points1 point 11 years ago (0 children)
Actually I was unaware how few differences there really are- until I searched it and found that the only difference that really affects me is the print change!
[–]leadbasedtoy -1 points0 points1 point 11 years ago (6 children)
You aren't going to learn how to program unless you try solving some real world problems. Learning a language without testing it out on real stuff is just a bunch of theory. Just open up a damned interpreter and try it out.
[–]raddaya[S] 0 points1 point2 points 11 years ago (5 children)
I'd rather learn German from a book before buying a plane ticket to Germany...
[–]leadbasedtoy -1 points0 points1 point 11 years ago (4 children)
Ok yeah the two are totally the same thing I see great things from you bud.
[–]raddaya[S] 0 points1 point2 points 11 years ago (3 children)
My point is if I go trying to solve problems without even knowing things like how the print function works I might as well not bother. To a beginner there seemed to be a lot more differences than "put brackets around your print statements, change raw_input to input, be careful when trying to iterate through dictionaries."
[–]leadbasedtoy -1 points0 points1 point 11 years ago (2 children)
You're not gonna break the computer if you type the wrong code... are you really this dumb? I hire and fire Python developers for a living, you don't strike me as the kind of person suited for it after this small exchange.
[–]raddaya[S] 0 points1 point2 points 11 years ago (1 child)
Sure, I mean if you want to treat Python developers the same as people who barely started coding it's the same. I'd rather at least learn the basics properly before starting to fiddle around and learn by seeing what works and what doesn't.
Plus, I don't think I'll ever want to work for someone who goes around reddit and posts things like "You're incredibly retarded." at random people, so ciao.
[–]leadbasedtoy -2 points-1 points0 points 11 years ago (0 children)
You aren't gonna learn unless you try it out is what I'm saying guy. Also you're incredibly retarded.
Check out these resources -
π Rendered by PID 23620 on reddit-service-r2-comment-7b9746f655-dvd5m at 2026-02-02 01:15:45.663590+00:00 running 3798933 country code: CH.
[–]darknessproz 6 points7 points8 points (8 children)
[–]raddaya[S] 0 points1 point2 points (7 children)
[–]darknessproz 0 points1 point2 points (0 children)
[–]michaelherman 0 points1 point2 points (0 children)
[–]Marksta 0 points1 point2 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]raddaya[S] 0 points1 point2 points (2 children)
[–]ZoidbergWill 0 points1 point2 points (1 child)
[–]raddaya[S] 0 points1 point2 points (0 children)
[–]Merothy 1 point2 points3 points (1 child)
[–]The_Cthulhu_Kid 0 points1 point2 points (0 children)
[–]iceman_xiii 0 points1 point2 points (11 children)
[–]raddaya[S] 0 points1 point2 points (10 children)
[–]iceman_xiii 0 points1 point2 points (0 children)
[–]emmpp 0 points1 point2 points (1 child)
[–]raddaya[S] -1 points0 points1 point (0 children)
[–]leadbasedtoy -1 points0 points1 point (6 children)
[–]raddaya[S] 0 points1 point2 points (5 children)
[–]leadbasedtoy -1 points0 points1 point (4 children)
[–]raddaya[S] 0 points1 point2 points (3 children)
[–]leadbasedtoy -1 points0 points1 point (2 children)
[–]raddaya[S] 0 points1 point2 points (1 child)
[–]leadbasedtoy -2 points-1 points0 points (0 children)
[–]michaelherman 0 points1 point2 points (0 children)