r/learnpython • • 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.

16 Upvotes

55 comments sorted by

View all comments

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.

I always find myself getting error codes, even when I follow the tutorial exactly,

There are two things to unpack.

  1. 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.

  2. 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 a is not the same as A in many programming languages (there are case insensitive ones, though, but Python is not one of them). True is not the same as true and so on.

Does anybody have any tricks on how to deal with this learning curve?

  1. proper course

  2. practice, practice, practice

  3. get acquainted with the language documentation. Learn to navigate, read, and understand it

  4. learn to read, understand, and interpret error messages - they are all helpful and meaningful

  5. 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.

  6. 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.

1

u/Glittering-Olive-404 1h ago

Hello! This is a really, incredibly comprehensive reply and I appreciate you so much for putting time into this. I’m in lecture right now so I don’t have time to fully digest it but I have it saved in my notes so I can come back to it! This gave me a lot of insight on stuff that I wasn’t doing correctly and why I was getting so frustrated. I wasn’t taking the proper time to learn the steps of how to properly code and I was skipping parts of my learning curve hoping I’d be able to just magically figure it out. That was definitely my fault and this helped me a lot, I’m going to refer to this and use it as a checklist of sorts whenever I’m coding. Thank you so so much again! You have no idea how much this means to me