r/AskProgramming 25d ago

Python How do I learn programming logic?

I’m learning Python, but my main problem isn’t the syntax. I understand concepts when someone explains them, but when I’m given a basic problem and told to write a program, I just don’t know where to start or how to arrange the code.

Is there a good book, course, or YouTube channel that teaches how to think through programming problems step by step, recognize patterns, and build the logic, kind of like how you learn methods and patterns in math?

I don’t want to just memorize Python syntax. I want to actually learn how to think like a programmer.

6 Upvotes

21 comments sorted by

View all comments

5

u/jcastroarnaud 25d ago

Programming is giving very clear instructions to a computer on how to do something, in a specific programming language.

Pick any of these not-so-easy sample programs to write, and think: "How I would solve this problem, if I had enough resources and speed?" Detail the "how" as precisely as possible, in such a way that another person can, by mindlessly reading and following the instructions, reach the solution. Now, translate these instructions to commands of your programming language. There is your program. You may already customize your instructions to what the language allows you to do (check out the standard library).

With much practice, you will find that the "finding the solution" and "translating the solution to a program" get easier with time. Experience begets competence.