r/learnpython • • 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

128 comments sorted by

View all comments

77

u/desrtfx but other languages pro 4d ago • Bravo

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.

7

u/PossibleProgress3316 4d ago

The problem I've found with all the tutorials is they just give you basics but they don't teach you how to actually make it all work, I want to learn how to actually build the application not just what a variable is but how it actually works in the application you are building, MOOC is definitely a good resource though

3

u/Corruptionss 1d ago

On the offside, I've been coding in Python for about 10 years. The last year and a half I've been using Claude code to build everything. Then one time Claude code couldn't take something I manually built without misinterpreting the hell out of it so I had to manually make changes. Realized how much skill I lost in that year and a half

2

u/GrowlingOcelot_4516 3d ago

Oh my! I didn't know they made it public!

Their course is amazing. Also the one from Aalto uni! Finns produce great courses

7

u/desrtfx but other languages pro 3d ago

The Helsinki Python MOOC has been public since 2021. Just gets a new URL every year. Currently: https://programming-26.mooc.fi - next year https://programming-27.mooc.fi

1

u/GrowlingOcelot_4516 3d ago

I did one from another learning platform. Maybe it was from Tampere uni. But overall, all their courses are great and I love that they make it publicly available.

2

u/desrtfx but other languages pro 3d ago

Before they switched their "Introduction to Computer Science" curriculum to Python, they had their Java MOOC open as well and it is up to today one of the best introduction to Java courses around.

Same for their "Fullstack Open" course (not for complete beginners, though).

The University of Helsinki has always been an absolutely fantastic learning resource.

1

u/WoefulBryan 3d ago

try writing the whole script in comments first. then tackle each comment one by one.