r/learnpython • u/Glittering-Olive-404 • 11h ago
How Do I Actually Learn Python?
I’m sorry, this is probably a really dumb question but I’m picking up python as a hobby to learn between work and classes. I’ve never coded before and I’m not interested in doing it career-wise or anything like that. I just want to be able to understand the fundamentals of it. I’ve gone through many online courses as well as YouTube tutorials. I always get it in theory, when they explain the strings, integers, and whatnot, but when I actually go to write lines of code, I always find myself getting error codes, even when I follow the tutorial exactly, which honestly baffles me.
Does anybody have any tricks on how to deal with this learning curve? Something that might be extremely common knowledge to everybody else that I’m missing? Or any resources they could provide? I really want to learn how to code, I’m just not sure how I begin troubleshooting something that I don’t understand, if that makes sense.
1
u/desrtfx but other languages pro 6h ago
Stop youtube tutorials that give you the code and only make you retype it. They are useless.
Do a proper course: MOOC Python Programming 2026 from the University of Helsinki. Free, textual, extremely practice oriented and a proper first semester of "Introduction to Computer Science" course. The course, contrary to most tutorials does not give you the code to retype/copy but instead gives you the tools and makes you, the learner, develop the solution and implement it in code.
You need to program, which means that you need to develop everything from a given problem, to an algorithmic step by step solution for the problem and its sub-problems, that then, finally, can be implemented in code. Code is a late step in programming. It is not the beginning.
There are two things to unpack.
Errors always tell you something. You need to learn to read, understand, and interpret the errors. Google (and, even though I don't like to recommend it, AI) can help a lot here.
If you really did precisely copy the code from the tutorial there wouldn't be any errors. Programming is a domain of precision where even a missed comma, a misplaced semicolon, a large letter where a small one is expected and vice versa can cause huge problems. Alone in variable naming
ais not the same asAin many programming languages (there are case insensitive ones, though, but Python is not one of them).Trueis not the same astrueand so on.proper course
practice, practice, practice
get acquainted with the language documentation. Learn to navigate, read, and understand it
learn to read, understand, and interpret error messages - they are all helpful and meaningful
learn to trace and debug your code - start with simple print statements and later move to using a proper debugger with breakpoints and step-by-step execution. Also, learn to trace your code in your head or on paper. These are all very important skills to build up.
Patience. Learning programming is not easy and it takes considerable time, persistence, discipline, determination, patience, effort, and a certain stubbornness to not give up when things go haywire or rough.