Total beginner looking to learn Python
November 29, 2022 8:12 AM   Subscribe

I'm a total beginner looking to learn Python. What are your favorite online classes, books, or other resources for this endeavor? I'm not entirely sure what sort of learning style might suit me best, so I'm interested in any and all possible approaches. Thank you!
posted by Conrad Cornelius o'Donald o'Dell to Education (18 answers total) 28 users marked this as a favorite
 
Had a friend buy this course for about $10 and said he enjoyed it,it helped him understand Python.

https://www.dmtecheducation.ca/p/learn_python_easily

Also,I just found this,perhaps it will help you:

https://www.freecodecamp.org/news/learn-python-book/
posted by LOOKING at 8:21 AM on November 29, 2022


Couple of standard suggestions:

Harvard CS50's Introduction to Programming with Python

Learn Python 3 The Hard Way (The title is bait. This isn't an especially hard book.)

And then a couple of more project-oriented books which might work if you're interested in the subject:

Automate the Boring Stuff with Python

Lean Python Visually
posted by caek at 8:38 AM on November 29, 2022 [3 favorites]


I switched mostly from PHP to Python dev a couple years ago, and mostly did that through Udemy courses (and a lot of actually writing things). These were the couple I used: Complete Python Bootcamp and Python Django. Fair warning: I outright skipped most of the basic intro stuff in these - my goal was getting up-to-speed quickly on how things were laid out in a Python/Django project and things like that - but I did go through them a bit to see what the instructor's style was like, and both of these seemed pretty good. They both start off at ground zero (or pretty close to it). (I used the first one more, though.) Udemy is not free but in my experience it worked pretty well. They also are almost always running sales, so the courses can be pretty cheap.

It'd probably be a good idea to have an inkling of what you want to do too - do you want to do Web stuff? Or are you going to want to do AI things? Or embedded computing (Arduinos, Raspberry Pis)? If you have a sort of broad interest in mind, you can look for stuff geared towards that particular space too. For example, if you want to build Web apps, you'll want to get a handle on Django or Flask (both written in Python and provide a lot of handy stuff you'll need to do Web app related things). Or, for AI, you can look for tutorials specifically for TensorFlow or something.

Also, I generally find RealPython to be pretty helpful.
posted by mrg at 8:43 AM on November 29, 2022


There are lots of intro-to-Python classes, books, etc. these days that assume different goals and prerequisites. Can you talk a little bit about the reasons you're looking to learn Python and what you might want to do with it? For instance, if you are an artist interested in using Python to generate poetry and post it to a website, I'd point you to a different curriculum than if you were a biologist aiming to analyze field data, versus if you want to automate some photo processing on your own computer, versus if you want to play with it as a general "my first programming language" experience, etc.

You mention that you're a total beginner. Just to double-check that: Have you ever used the command line (also known as the terminal) on your computer? That's something you'll probably need to learn along the way, just so you don't get surprised when some materials assume you know it already and say "type [thing] at the prompt in the terminal".
posted by brainwane at 8:44 AM on November 29, 2022 [7 favorites]


Also: welcome to Python! It's the only programming language I'm really at all fluent in, so it's kind of a home for me. And it's useful in a lot of different domains -- art, journalism, web applications, sciences, games, hardware, personal productivity, etc.

It's worth looking up your local Python meetup on meetup.com -- they will often have online and in-person meetups for new learners that will help support you with training-type classes as well as more free-flowing project nights where you can get help with whatever you're working on.

While learning, I got a lot out of the free CodingBat programming exercises website. "Going through many practice problems is a great way to solidify your understanding of how the code should work."

And if you run into headaches while installing "packages" (pre-made bits of Python code other people have developed and made available for you to use, sometimes also referred to as "libraries"), please know there's a lot of obsolete info available in old blog posts, StackOverflow threads, etc. that might throw you off. Here's the most reliable guidance.
posted by brainwane at 8:52 AM on November 29, 2022 [1 favorite]


I learned some Python during the 2020 lockdowns. I was a complete beginner with no coding or computer science background.

I started with some of the very short FutureLearn courses from the Raspberry Pi foundation. For example: https://www.futurelearn.com/courses/programming-101

Then I did quite a lot of this course from Udemy: https://www.udemy.com/course/100-days-of-code/

Then I started messing around with things on my own, such as registering for a developer account on Twitter and using the Tweepy library to monitor for people mentioning colours, then using the Phillips Hue API to change the colour of one of my lightbulbs whenever anyone mentioned a colour on Twitter. It worked, more or less, and it was a lot of fun too.

Final thought: I later tried to learn JavaScript. I lost focus on this for several reasons (including being out of lockdown) and found it much less fun, less inspiring, and all round less rewarding. A large part of the reason for this was the difference in the feel of the community. The Python community really welcome amateurs, kids, and complete noobs. A lot of people who learn Python aren’t aiming to become professional coders, they just to want to have fun and maybe hack something together with a Raspberry Pi and some LEDs. So you have this wonderful community of hobbyists and fun-havers. Whereas with JS, most of learning resources out there are aimed at aspiring professional coders, so the whole online culture is different. It’s much more careerist, urgent, “You NEED to know this!” and generally less concerned with beginners having a lovely time. So I’d say if you’re learning Python make sure to enjoy the fun and welcoming community out there. It doesn’t have to feel like work, so think twice about engaging with resources that make it feel like that if that’s a turn-off for you.
posted by d288478 at 9:26 AM on November 29, 2022


For an absolute beginners' textbook, I like Alan Downey's Think Python, free online at the link.

For code examples, I like Peter Norvig's pytudes. Some of these might look too advanced for a beginner, but they do give an idea of what's possible.
posted by JonJacky at 9:33 AM on November 29, 2022 [2 favorites]


I work in tech, but on the design side. I've always been curious about coding so a few years ago I taught myself the basics of a few languages. Python is by far the one I'm most confident in.

You're going to get a lot of recommendations for courses and resources here, which, great. But the one thing that tied it all together for me was having an outcome in mind. In other words, a goal.

For me it was a NaNoGenMo project. For you it might be something creative, or perhaps not - a cool dataset you'd like to dig in and visualise? Messing around with some GPT-like machine learning models?

Whatever it is, having a specific project in mind will focus your learning and give you the dopamine hit of success that will help you learn so much faster.
posted by Ted Maul at 9:33 AM on November 29, 2022 [4 favorites]


When I first started learning Python (with a very weak programming background), the first thing I did was work through Google's Python class. It's just the absolute basics, which are good to have before starting any of the more involved courses.
posted by no regrets, coyote at 9:37 AM on November 29, 2022


The official python docs page is here, python 3 docs. While there is a tutorial, unless you already know about programming, its probably not sufficient.

I would heavily use the tutorial & library ref as a reference supplement to whatever intro / tutorial / class you take. Im shocked at how many materials don't mention it. As a working developer i refer to it frequently.
posted by TheAdamist at 9:43 AM on November 29, 2022


brainwane: You mention that you're a total beginner. Just to double-check that: Have you ever

... written computer programs?

A couple of years back a few colleagues and I were enrolled in a Python course, as it was expected to be useful for the direction our daily work was going. It would be a tool to help manage the systems we maintain.

One of my colleagues had not even written a single line of BASIC ever, let alone an actual program, however small. So the entire concept of building a program: identifiers, expressions, logic and what have you was totally new for him, and as the course was aimed at people who already knew an IF from a WHILE that must have been royally frustrating. Obviously it was the wrong level for him, but that wasn't clear from the course description we were given (filtered through HR and at least one management layer).

So if you say "absolute beginner": is that in Python, or in programming in general?
posted by Stoneshop at 10:20 AM on November 29, 2022 [1 favorite]


Response by poster: Thanks for all the ideas, everyone! To answer the two main questions here:

1) I'm interested in using Python chiefly for data manipulation. To take a recent example: The NYT posted election results for Maine in this JSON file. A colleague graciously wrote a small bit of code in Python to pull out the town-by-town results in the governor's race and dump them into a CSV file that a human could readily use and understand. That's the kind of thing I want to be able to do, since my job regularly involves extracting data from messy sources.

2) I have programmed before ... decades ago, in BASIC and Pascal. So the most very basic concepts, like variables, are something I'm familiar with. But not much beyond that!
posted by Conrad Cornelius o'Donald o'Dell at 9:45 AM on November 30, 2022 [1 favorite]


I find two good places to tinker with code are repl.it and Jupityr Notebooks
Using these minimizes having to learn the setup stuff and lets you get right to the code. Plus they will both have examples for you to look through. I'm more of a 'reverse engineer' learner and find looking at other peoples projects helps me piece together how something works.
posted by CleverClover at 8:39 PM on November 30, 2022 [1 favorite]


Thanks for the answers! Given your experience and goals, I would recommend the Data Carpentry lessons or the Google intro-to-Python materials mentioned above.
posted by brainwane at 9:02 PM on November 30, 2022


BTW have you heard of The Bad Data Handbook?
posted by brainwane at 9:04 PM on November 30, 2022


Response by poster: I'm more of a 'reverse engineer' learner and find looking at other peoples projects helps me piece together how something works.

Yes! This is a really good way of putting it. I think I lean more toward this approach as well. I tried some lessons on Codecademy but it felt like they were trying to teach me French one word at a time—not an approach that really gelled for me.

And no, I hadn't heard of the Bad Data Handbook, but that looks like a great resource. My only question is: Why is there a goose on the cover?!
posted by Conrad Cornelius o'Donald o'Dell at 10:07 PM on November 30, 2022 [1 favorite]


The book has a goose on the cover because that series of books from that publisher (O'Reilly) always puts pictures on animals on the cover. Perhaps they chose a goose because bad data is bad-tempered?

Since what you want to do is data science/analysis and maybe learning to find and tell stories with data, phrases like "data journalism" and "data storytelling" may be helpful for you to look up. Some more resources:

Check out OpenNews SOURCE's guides to wrangling datasets and "The Totally Incomplete Guide to Finding and Publishing Data".

The Pudding publishes lots of longform data journalism, and sometimes (as in this example) the underlying code is in Python.

Data journalists sometimes write "How we did this" reports, like "How We Made the Force Report Database" in SOURCE and The Markup's "How We Analyzed Amazon’s Treatment of Its 'Brands' in Search Results", and "How (and Why) We’re Collecting Cook County Jail Data" at Pro Publica, and often include links to their source code.

You'll often want to work in interactive "notebooks", usually Jupyter Notebooks. Notebooksharing.space is a way to easily share your notebook with someone else, like here in Ask in case you are asking for help with debugging. And you can browse other people's published notebooks at Observable.
posted by brainwane at 4:52 AM on December 1, 2022 [1 favorite]


I really enjoyed Colt Steele's python class - I found the instructor's manner to be great.
posted by taltalim at 10:55 AM on December 5, 2022


« Older What are the best things to make at home?   |   Questions and Answers and MeFi Newer »
This thread is closed to new comments.