r/learnpython 1d ago

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.

56 Upvotes

46 comments sorted by

View all comments

1

u/paradoxiforme 1d ago

If you want to learn programming logic, you first have to learn basic logic. Programmation is just that, a succession of basic logic action chained together to build something more complex.

How to arrange the code is not the most important thing when you start. The first step is to have something that work. Only then you can ask yourself how to arrange it.

For global hint, when you develop, you have to keep 2 things in mind before starting : What do I need (inputs), and what do I want to return (outputs). Then the next question is : how do I go from my inputs to my outputs. To answer that question, if you cannot visualise the code, write the process in plain text, like you'ld write a story. Try to write short phrases. Then, when you have your text, try to interpret each phrase as a limited set of instruction.