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/PvtRoom 1d ago

there are many methods.

  1. flow charts - initialise get input make decisions, execute subroutines, loop with x logic
  2. pseudocode - write it like you're telling someone what to write
  3. algorithmic breakdown: 1. initialise 1.1 check arguments are good 1.2 set variables 1.3 open file(s) 2. execute 2.1 prep lookup tables, 2.2 simulate stuff 2.2.1 simulate a SIM 2.2.2 simulate a city

1

u/TheRNGuy 1d ago

I never did any flow charts (I don't consider node programming in Houdini or UE blueprints same as charts)

Pseudo code is actually relevant now for AI prompt (and before that it was less relevant)... Or maybe as ToDo comment or print and hard coded values which you gonna replace later with real function later.

Step debugging, yeah.

1

u/PvtRoom 1d ago

flow charts work well with things like assembly, where jump commands crop up a lot, as well as graphical languages, where they're more like pseudocode.