r/learnpython • u/TheAzGreenPhoenix • 4d ago
Learning Python at 37 and I can read code fine but can't write 10 lines without the lesson open
37, learning Python in the evenings for about 3 months. I can read other people's code and follow every lesson, but the moment I close the lesson and try to write something small on my own, like a script to rename my photos, I'm stuck after a few lines. I did a free intro course before this and hit the same wall, so this time I'm paying for something structured. What made writing code on your own start to click?
286
Upvotes
View all comments
77
u/desrtfx but other languages pro 4d ago •
You need to write code on your own - practice.
Practice is the only thing that can help you improve.
Sit down with pencil and paper and plan your program. Write down the overview, then detail each part. Then, develop your solutions for each part. Then, once you know what to do, start programming it.
It is a very common problem nowadays that people can follow tutorials that pre-chew and serve everything for them, yet, they never learn to think independently. That's why most tutorials around are actual garbage. They serve the solutions instead of making the learner work to develop the solutions.
A proper course, like the MOOC Python Programming 2026 from the University of Helsinki, does the opposite. It hands you the tools (keywords, commands) and demonstrates how to use them, then makes you do the actual programming through plenty practical exercises where you only get the prompt and have to develop the solution on your own. The course gives everything you need in the preceding textual chapters and then has you use what you learn.
The difference between reading and understanding code and writing it is the same as reading and understanding novels and writing comprehensive, fully developed ones. Just because you can do the former does by far not enable you to do the latter. In order to do the latter, you need to write. You need to write plenty bad ones.