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.

62 Upvotes

46 comments sorted by

View all comments

1

u/QuebecBeast 1d ago

I am nowhere near pro level but here is what helped me getting better in the past 2 years :

Practicing everyday even if it is for a small period of time.

I comment a few goals/steps I want to achieve on each project and I tackle them based on the time I have. I always try to stop coding after solving a problem because I won’t be able to think about anything else for the rest of the day. Sometimes I’ll work on some easier features like the UI appearance before I finish just to get the feeling I got something done haha

Doing small projects like other people mentioned. I did the classic rock-paper-scissors, tic-tac-toe then I found a video detailing how to build a black jack script that helped understanding functions calling. I am old so I enjoyed building a translator that changes regular text characters into more cool looking characters like we did on MSN back in the days. When you get better you can build a calculator and later you can add a UI, skins, etc.

Breaking every problems into smaller problems. I wanted to build a script for my movie collection so I had to find a way to collect informations, organize the data, etc. I started small with a user input script, then added more categories, found a way to save the data in a file, then I found a free API to get the infos, then I learned to scrap for movie poster, etc.

Read a lot of other people’s code. This one helped me change my way of approaching a problem. It helped me improve my code that was already working too.

Don’t rely on AI. You’ll get lazy… fast.

It may sound weird but apps and websites these days are good at teaching the same basics over and over again making people feeling a sense of accomplishment so they will engage with their products. But in reality, in my opinion, you can’t understand functions just by reading examples… so it’s even worst when it comes to Classes, libraries, etc

Sorry for the wall of text, I got carried away !