I'm learning Python and feeling frustrated because I can usually follow along when an instructor explains code. I understand what the different parts do, but when I'm given a problem and asked to write a solution from scratch, my mind goes blank. I can often understand a solution after seeing it, yet I struggle to come up with the logic and translate it into Python on my own. Is this a normal stage of learning programming? What helped you move from recognizing and understanding code to writing it independently? Should I focus on more exercises, small projects, rewriting examples without looking at the solution, pseudocode, or something else?
5 Answers
Treat this like learning math or a spoken language: being able to understand an explanation doesn’t mean you can produce the answer immediately. When you get stuck, write down what the program should do step by step, attempt the code, and test each piece. The blank-page difficulty will shrink through repeated practice, not by watching more explanations alone.
Watching tutorials can create a false sense of progress because the instructor is making all the decisions for you. Pause frequently, close the lesson, and rebuild the example from a blank file. You can also change the example, deliberately break it, and extend it with one new feature. Getting stuck and fixing the result teaches much more than passively following along.
Use tiny projects as practice instead of waiting until you feel ready. For example, write a program that prints a greeting, then repeat it several times, accept a name as input, validate the input, and process several names. Each small variation gives you practice using loops, functions, conditions, and arguments while keeping the overall problem manageable.
Try not to solve the logic and the Python syntax at the same time. First describe the solution in plain English, a checklist, a flowchart, or pseudocode. Break the task into tiny steps and solve one step at a time. Once the plan makes sense, look up any syntax you’ve forgotten. Searching for syntax is fine; the important part is learning how to plan the program.
Yes, this is very normal. Understanding code when you see it is recognition, while writing a solution requires recall, planning, and problem-solving. Those are related but separate skills, so the main way to improve is to write more code without relying on a finished solution. Start with very small programs and gradually make them more challenging.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically