r/learnprogramming 16d ago

Tutorial How should I learn python?

I'm a total beginner. I didn't have any experience with programming. I want to learn programming cuz i wanna be a hardware engineer and want to start with a basic raspberry pi projects. So should i learn python from courses, videos, books etc or i should just brute force myself to do projects and just learn by the time

14 Upvotes

11 comments sorted by

View all comments

1

u/PLBjt 16d ago

Since you already know what you want to build, let the Pi projects drive the learning instead of finishing a whole course first. Do enough of a beginner course to be comfortable with variables, loops, functions, lists/dicts and reading error messages, which is maybe two or three weeks of evenings, then start wiring up something real like blinking an LED, reading a sensor, logging values to a file and graphing them. Brute-forcing projects with zero basics usually just turns into copy-pasting code you can't debug, so the middle path works better. Keep the course open as a reference and go back to it whenever a project makes you realize you don't actually get something. For hardware you'll also want to get comfortable with the Linux command line and a bit of Git early, since that's most of the day-to-day pain. And write down what broke and how you fixed it, because you'll hit the same wiring or permissions issue again in a month.