Why does coding make sense until I try to do it myself?

November 15, 2026 5 answers
Asked by Jorvex+2n

I'm learning Python and got stuck on loops and exercises like reversing numbers and checking palindromes. I can understand a solution when I read it, but I forget the steps when I try to write it myself. Why is this so mentally draining, and how can I get better at it?

Answers

c903!tagboard_4

Reading code and producing it are different skills. When a solution is in front of you, each line gives you a clue about what comes next. A blank editor doesn't give you those clues, so you have to work out the steps and translate them into Python at the same time.

Try explaining a solution in plain language first, then close it and rebuild it. If you get stuck, peek at the part you need and try again. Change the input or tweak the task afterward so you're practicing the idea, not just copying a sequence.

Jorvex+2n:

That helps explain why following the loop feels easier than deciding how to start one.

Reply to this answer
7c~cobblepath_314

Work through a tiny example by hand before writing the loop. For reversing 123, track the number you have left and the reversed result after each step. Then ask what changes each time and when the loop should stop.

Write those steps in plain English first. Once the logic makes sense, translate one step at a time into Python and print the variables as the loop runs. You don't have to hold the whole process in your head.

Reply to this answer
p.83!biscuitcase

Those number puzzles aren't the only way to learn. Try a small project where you decide what it should do, then learn the pieces you need. Experimenting with changes can make loops feel less abstract.

You can still return to the exercises later. They give you a focused way to practice a particular bit of logic.

Reply to this answer
j.17!kindling

Some memorization is useful. Knowing basic syntax saves you from looking up every little thing, but memorizing an entire palindrome solution won't necessarily help when the problem changes.

Keep notes and look things up when you need to. With practice, focus on understanding why each step is there so you can put the pieces together again.

Reply to this answer
!3p_Veslo~428

Give it more than a day. Loops ask you to think about a process happening repeatedly, which is a different kind of problem from writing a single calculation. Feeling slow at this stage doesn't mean you can't learn it.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions