3
Hit a snag with Python loops as a new coder
I started learning Python recently. Nested loops keep tripping me up no matter how many tutorials I watch. What's a good trick to make them click?
3 comments
Log in to join the discussion
Log In3 Comments
cora_jenkins1mo ago
Barbara's drawing trick never worked for my brain type.
7
barbara8641mo ago
Draw each loop on paper to see the layers. I used to just stare at code, but sketching it out fixed my confusion. Label your counters and follow one full inner loop per outer step. That visual trick turns abstract nesting into something you can really follow.
6