Python: where to start
By Samantha G. Zeitlin
I spent about a year learning Python when I first got back into coding. A lot of people have asked me where to begin. Here’s a guide to what I found useful (or not) and why.
- Learn Python The Hard Way by Zed Shaw.
I started here. I did the free online version.
I like the advice he gives you to just type things in, even if you don’t know what’s happening yet. This required a bit of an adjustment to my usual mindset, where I question everything all the time.
A hint: Sometimes when I was completely stuck and frustrated, it would turn out that was sort of the point. Often, he explains the concept in the next lesson. So sometimes if you’re stuck, just go on, it will make more sense.
Another hint: Start using Github if you aren’t already doing that.
Partway through LPTHW, I was feeling a little stuck and uncertain about how to proceed. To get unstuck, I did two classes called Learn to Program: (1) The Fundamentals and (2) Crafting Quality Code. They’re from the University of Toronto, and they are team-taught by Jennifer Campbell and Paul Gries.
For me, Jennifer’s style of teaching worked really well. And I really appreciated having a female teacher. It’s amazing how much this matters - and I say this coming from years of school where almost all my professors were men.
I liked that these classes were auto-graded, and the exercises were useful for getting more practice and confidence with very basic concepts that you’ll use over and over again. Many of the questions were the sort of thing you’ll see a lot of in the whiteboarding section at job interviews, e.g. Cracking the Coding Interview.
It’s worth noting that these two classes are taught using Python 3, which is going to be in wide use sooner than you might think.
After that, I wanted something even more hands-on, so I did another Coursera class called An Introduction to Interactive Programming in Python. This one is taught out of Rice by a group of 4 white guys (sorry, it’s true).
They have you write basic games using their own simplegui javascript engine, so you get some practice setting up animations and testing longer programs where you have to write several modules and hook them together. It’s fun, and you get to write classic games like Pong. I found writing games to be really satisfying.
Personally, I was a little bummed that because of the simplegui mechanism for hooking up the graphics, you have to edit and test the code in a browser, and that was a little bit buggy (I’m sure they’re continuing to work on it…).
Also, they had multiple card games towards the end, and I don’t like card games, so that wasn’t very motivating for me. I think we could have handled a simple version of Tetris just as easily.
This class introduced Object Oriented Programming, but to be perfectly honest, I didn’t get it at all the way they explained it. Then I had to go find another resource to get me un-stuck again.
Note: some Coursera classes explicitly ask you not to share your answers online in any form, including Github. Read the course instructions carefully. If you still want to have things on Github but not share them publicly, you can pay a small fee for a private repo (I did this for a little while, so I could share my coursework with potential employers).
- Object-Oriented Programming
In looking for ways to get comfortable with OOP, I searched high and low and ended up with both ends of the spectrum.
Hello, World! is an introductory book written for people with no programming experience.
I found a module through MIT OpenCourseWare for engineering students on the way to building robots. They do a unit reviewing OOP that includes some very useful exercises.
- Meet other programmers IRL! meetup.com
If you haven’t already, there will come a time when you feel isolated and stuck.
If you don’t happen to have a professional Python programmer in your house to answer questions 24-7, or if you just want to work with other people who are closer to your level, I recommend reaching out. Groups like Women Who Code put on events all the time, and their goal is to have even more. Join us!
Lynn Root has made a website with some great tutorials, and I’ve been to several PyLadies events, all of which were incredibly useful, both for the informational content and the camaraderie.
- Puzzles and other tools:
If you’ve run out of courses and want to learn more advanced material, like list comprehensions, generators, decorators, etc. check out the free videos from Pycon meetings. For example, these. You could even attend a meeting!
If you’re looking for more ways to practice and just aren’t sure what to do, it can be hard to know what’s appropriate for your experience level. It’s easy to be intimidated if all the recommendations you can find are way over your head.
Python Challenge is a puzzle. I made it a few steps in before I got stuck. But I like solving puzzles, so I expect I will go back and try to do some more.
Python Koans is “an interactive tutorial for learning by making tests pass”. It’s a little more advanced, and will teach you things you won’t see in most classes.
Rosalind is a set of bioinformatics challenges, which are very accessible if you’re like me and come from a molecular biology background. Sometimes it’s nice to have something familiar, where the applications are something you can easily relate to. Maybe you’ve done it before using other tools (or even by hand), so you understand the problem space really well.
There are tons of other things out there, and if you’re looking to collaborate on code, look for open source projects where you can make contributions.