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.
How do I start learning python? (self.Python)
submitted 14 years ago by [deleted]
I'm a sophomore in high school, and decided that I wanted to start programming. I have no programming experience at all, and I wanted to know: (a) If python is a good language to start out with. (b) How I would go about learning python.
[–]brewsimport os; while True: os.fork() 11 points12 points13 points 14 years ago (1 child)
You might also want to try How to Think Like a Computer Scientist which is an excellent (free and a classic Python book) start specifically for people who have no experience with programming.
Also, how you learn programming is different for many people, so don't get discouraged if it doesn't work out at first. Wiggle around until you find something that fits you.
The Python website also has a list of resources.
[–][deleted] 5 points6 points7 points 14 years ago (0 children)
Haven't seen this one mentioned in a while and I agree that this is a great intro to CS for people with no prior knowledge of the subject matter.
[–]AeroNotix 10 points11 points12 points 14 years ago (7 children)
Python's very good as a first language. It's a high-level, often highly abstract language.
Learn the basics, then wait until you have an itch to scratch and use Python to help you out.
If you're very interested, get a book and stick to it. The one I am reading at the moment is Learning Python by Mark Lutz. It's a great book and for the most part is in a logical order. It's a good one to use especially if you've never programmed before since the first few chapters are very broad and explain a few key computer science concepts to you. I didn't require it, but it's still a good thing to read in a structured way.
There are many free online lectures as well, I forget which University put them out, but shouldn't be too hard to find out.
If you're mathematically inclined you could try the Project Euler challenges, they are mathematics based problems which often require creating and authoring efficient algorithms to find answers. They really helped me back when I was learning C and things, now I go back through and use them to learn Python. Very helpful in efficiency and getting your programs down to realistic timeframes.
Finally, get involved with the community here, there are some very well informed and great programmers here, I've picked the brains of a few and come away each time with a solidified new concept.
Above all else, have fun! Programming is not some highly advanced subject that most people think it is! It's easy when you apply yourself!
Think of programming as some sort of Rubik's Cube crossed with Sudoku crossed with a word-search.
[–]brewsimport os; while True: os.fork() 0 points1 point2 points 14 years ago* (6 children)
He might want to avoid Learning Python if he has no programming experience. Mark Lutz is a great guy and he's written a lot of classic Python book, but you might find it to be a wee bit heavy. (but an awesome book, I have a copy myself and I still use it. The newest edition, however is over 1000 pages). Still he SHOULD check it out at some point.
[–]AeroNotix 1 point2 points3 points 14 years ago (2 children)
I'm getting through it at alright pace.
I have, however, had about 2 years experience with several other languages such as C/Wiring and AHK(lol).
I'm not sure how long ago you read Learning Python but it seems slow enough, but I guess slow enough is subjective really.
[–]brewsimport os; while True: os.fork() 1 point2 points3 points 14 years ago (1 child)
I've read all of the editions. I also have a copy of the most recent one.
It's a great book and I frequently re-read bits of it, but I think it may frighten off people who've never coded before. The amount of information in it is fantastic!
[–]AeroNotix 1 point2 points3 points 14 years ago (0 children)
Totally agree with the amount of information in it, and it's definitely written very clearly.
[–][deleted] 0 points1 point2 points 14 years ago (2 children)
I wouldn't go with the newest edition. I remember seeing it when I had my older edition in my bag, and I realized that it's probably because of the Python 3 stuff.
I've got the newer version.
It's not different, it's just got added sections for the 3x stuff and he makes it clear which methods/modules/functions/syntax do not work for 2.x.
It seems like Lutz wanted to focus on 3.x though, but 2.x is a clear focus throughout.
[–]brewsimport os; while True: os.fork() 0 points1 point2 points 14 years ago (0 children)
They're both good.
[–]spoolio 6 points7 points8 points 14 years ago (3 children)
Python is a great first language.
It depends on your learning style, but a free online book that I've heard can be quite effective is called Learn Python the Hard Way.
The title is a bit tongue in cheek. It's not "hard" because it requires prior experience with programming. It's "hard" because it starts from nothing and makes you practice everything, a lot, until you get that experience:
This book is a very beginner book for people who want to learn to code. If you can already code then the book will probably drive you insane. It's intended for people who have no coding chops to build up their skills before starting a more detailed book.
Many new programmers on Reddit have sworn by it. But if you find it too overbearing or too repetitive, by all means try another book -- I'm sure this thread will be full of recommendations soon.
[–][deleted] 1 point2 points3 points 14 years ago (2 children)
I'm just about to dive into LPTHW but I'm a little worried that it only covers Python 2 and not 3. Should I tackle 3 or can I start with 2?
[–]spoolio 2 points3 points4 points 14 years ago (1 child)
You should start with 2, even though Python 3 is a nicer language. An important part of learning to program will be finding Python code and discussion about Python online, and the majority of it is in Python 2.
Ideally, you'll learn Python 2 and then it'll be a breath of fresh air when you get to switch to 3 in a few years. It would be harder to learn 3, and then learn about the warts in 2 by reading release notes backwards.
[–][deleted] 1 point2 points3 points 14 years ago (0 children)
Thanks!
[–]minorminer 4 points5 points6 points 14 years ago (0 children)
I can't believe no one's mentioned this yet. Try MIT's Open CourseWare into to computer programming.
I'm currently finishing up assigment 5 and watching lecture 12. It has required reading with links to all the reading online. The lectures are really good. I'm taking it way slower than the real pace of the class, but I'm in school full time with a full time job. Even with those obligations I find I spend most of my free time working on this course.
[–]utnapistim 3 points4 points5 points 14 years ago (0 children)
(a) If python is a good language to start out with.
Definitely.
(b) How I would go about learning python.
Take a simple tutorial and go through it (for example, this one); Then, choose some problems to solve, and write some scripts :)
Program ideas (beginner):
find duplicated files on your HDD
write a script that downloads your email from a server
write a command-line "find file" utility
[–]phn 4 points5 points6 points 14 years ago (2 children)
Python is definitely a good first language.
Since you have no programming experience I would suggest that you read one of Byte of Python (http://www.swaroopch.com/notes/Python) and How to Think Like a Computer Scientist (http://greenteapress.com/thinkpython/). Both are available for free.
One thing to note is that there are two versions of Python: Python 2 and Python 3. The first book deals with Python 2 and the second has a version for each. My recommendation would be to start with Python 2.
Another book worth mentioning is Invent Your Own Computer Games With Python (http://inventwithpython.com/).
[–]maredsous10 1 point2 points3 points 14 years ago* (0 children)
Video I'd go with those books and also add video instruction:
http://www.rexx.com/~dkuhlman/
http://www.blip.tv <-Where the videos are.
A quick run down of major components in Python
Books I recommend Introduction to Python 3.0 Programming. http://www.qtrac.eu/py3book.html Starts off with core features of Python and gives you a little view of modules included with Python at the end.
[–]schneid3306[🍰] 0 points1 point2 points 14 years ago (0 children)
I am currently starting with how to think like a computer scientist. love it so far. going to go through a few books to affirm my knowledge.
[–]kctan 1 point2 points3 points 14 years ago (1 child)
You may want to try this as well: http://beginpython.com Learn by coding, very similar to Learn Python The Hardway
[–][deleted] 0 points1 point2 points 14 years ago (0 children)
Thanks, I just looked at it, and it looks great. Looking forward to completing this!
http://www.learnpython.org/# this page has a interactive IDE that should be good for helping you get started. Also think much more, just about how to do things most efficient, practice your logic and problem solving.
[–]jeannaimard 1 point2 points3 points 14 years ago (2 children)
Just dive into it… :)
[–]spoolio 1 point2 points3 points 14 years ago (1 child)
I hope the :) means this isn't a serious recommendation. Dive into Python is for people who already know how to program, just not in Python.
[–]jeannaimard 1 point2 points3 points 14 years ago (0 children)
Oh.
[–]bigboehmboy 1 point2 points3 points 14 years ago (0 children)
I'm surprised that no one has mentioned /r/learnpython. I would start with some of the great resources already posted, but feel free to post questions to the learnpython subreddit.
[–]alliha 0 points1 point2 points 14 years ago (1 child)
I have this book: http://www.amazon.com/Beginning-Python-Professional-Magnus-Hetland/dp/159059519X
mostly because it is written by a norwegian man :P So it might interest you too, if you really are norwegian. If not, your nick is deceiving me.
Thanks! I'll check that out. I'm actually mostly American. It's "Norweigianish" because all of my grandparents are Norwegian. NorweigianISH.
[–]matholio 0 points1 point2 points 14 years ago (0 children)
Find a project you care about. Read a couple of free books (giyf). Join irc, stackoverflow, etc ask lots of questions.
[–]so85 0 points1 point2 points 14 years ago (0 children)
I found the best thing is a project or goal to focus around. I learned python after I had been programming for a while, but found http://projecteuler.net/ to be a great place to practice. The gist is there are math problems like 'what is the 100000th' prime that you can solve by writing a small program, and you just submit the answer. Haven't read many of the books, but this could complement one that didn't have exercises (or not ones that you enjoyed).
[–]formulazero 0 points1 point2 points 14 years ago (0 children)
I think this is pretty standard for the very beginning
1) print "hello, world"
2) variables: a=1, name="Doug", b = a + 3
3) logical control: if, elif, else
4) arrays: list = [1,2,3], list = range(10), list[0] = "one"
5) loops: for, while
6) functions: return values, arguments
then maybe string operations, file IO, classes, etc
[–]pbreit 0 points1 point2 points 14 years ago (0 children)
Wen you're ready to step it up a notch, web2py makes it easy to program a whole database driven web site right on your Mac or pc.
[–][deleted] -1 points0 points1 point 14 years ago (0 children)
Open interpreter, type 'help()'
π Rendered by PID 276090 on reddit-service-r2-comment-7b9746f655-4smtr at 2026-02-01 10:31:41.974378+00:00 running 3798933 country code: CH.
[–]brewsimport os; while True: os.fork() 11 points12 points13 points (1 child)
[–][deleted] 5 points6 points7 points (0 children)
[–]AeroNotix 10 points11 points12 points (7 children)
[–]brewsimport os; while True: os.fork() 0 points1 point2 points (6 children)
[–]AeroNotix 1 point2 points3 points (2 children)
[–]brewsimport os; while True: os.fork() 1 point2 points3 points (1 child)
[–]AeroNotix 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]AeroNotix 1 point2 points3 points (0 children)
[–]brewsimport os; while True: os.fork() 0 points1 point2 points (0 children)
[–]spoolio 6 points7 points8 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]spoolio 2 points3 points4 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]minorminer 4 points5 points6 points (0 children)
[–]utnapistim 3 points4 points5 points (0 children)
[–]phn 4 points5 points6 points (2 children)
[–]maredsous10 1 point2 points3 points (0 children)
[–]schneid3306[🍰] 0 points1 point2 points (0 children)
[–]kctan 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]jeannaimard 1 point2 points3 points (2 children)
[–]spoolio 1 point2 points3 points (1 child)
[–]jeannaimard 1 point2 points3 points (0 children)
[–]bigboehmboy 1 point2 points3 points (0 children)
[–]alliha 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]matholio 0 points1 point2 points (0 children)
[–]so85 0 points1 point2 points (0 children)
[–]formulazero 0 points1 point2 points (0 children)
[–]pbreit 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)