Ask HN: What is your best way to learn Python programming language? | Hacker News

Chances are that my framework of learning is going to be different than yours. I find that most materials distract me from my real task - getting efficient and productive with a new tool.

I like to learn by doing projects. I'll usually pick three projects that I find somewhat interesting and figure out how to finish them with the new tool. I usually progress like this:

1.) Build the first project. 2.) Build the second project. 3.) Go back, read the first project and refactor it using what I've learned. 4.) Build the third project. 5.) Add a new feature to the first project. 6.) Refactor the second project. 7.) Add a new feature to the third project.

By the time I've made it through those steps, I'm fairly confident with my skills. I likely don't have full mastery of the language and it's ecosystem, but I have found good resources, learned where to ask for help, and learned enough of the ecosystem's language to be able to ask for more detailed help.

I also try to confine my learning to one subject. For example, you mention that you'd like to start doing some data analysis. If you have advanced knowledge in math/stats, that might be a great way to learn. But, if you don't, you'll have to learn the underlying science while you're learning to use the tool. With the way I learn, that is setting me up for failure.

Here is the thing though. My method works for me and I'm using it now to learn a new tool. But, I'm a sample of one.

A fellow named Zed Shaw has written a set of guides to learning new languages. His Learn Python the Hard Way is quite well regarded. Learning a language like that doesn't work as well for me, but that might be the exact way that you learn. To learn more, check out . If you like taking notes, this might be a good option for you. Only, you might find that your muscle memory improves faster if you type the notes into a computer!

Alternately, there are some great classes that you can take online. MIT offers Introduction to Computer Science and Programming in Python through MITOpenCourseware and ItunesU. I already knew Python when I listened to that series, but I learned one hell of a lot through the lectures.

You'll still have to practice and write lots of code, but hopefully one of those resources helps you progress to the point that you feel your practice is beneficial. The key is to find a style that works for you and keep at it.

Programming is hard, so keeping at it is the most important part. It doesn't much matter how you learn as long as you don't quit. You'll learn the most when you're most frustrated, so take frustration as a sign that you're getting better. Depending on how you motivate yourself, you might want to keep a learning journal so that when you feel dumb you can flip back and realize that you were significantly dumber a month ago. :)

Good luck! And don't be afraid to ask for help. We have all been beginners and most really good developers are all beginners in something. Have fun and kick ass!