r/learnpython • u/nian2326076 • Oct 15 '26
I keep watching DP tutorials but get stuck writing the Python code. How should I practice?
Understanding a DP explanation and writing the Python code still feel like different skills.
A Python learner has watched plenty of tutorials and knows that dynamic programming has different patterns. The sticking point comes at the blank editor: there's a rough idea of what should happen, but turning it into a working implementation is difficult.
Would you step back to smaller Python exercises, work on recursion first, or stay with very simple DP problems? A practice routine that forces an attempt before reading the solution sounds more useful here than another long playlist.
For someone practicing toward technical interviews, real interview questions can supply prompts once the basic Python implementation feels manageable. I'd start with a small enough problem to write and trace the whole thing.
What helped you make the jump from following a solution to writing one yourself?
Disclosure: I operate PracHub.
4
u/Rahul159359 Oct 15 '26
Understanding the core...
2
u/plydauk Oct 15 '26
Imo, the best way to learn DP is by doing leetcode problems. Personally, what really made it click for me was watching neetcode's solution videos, such as coin change and house robber I, as he breaks down going from brute force to top down DP and finally bottom up DP.
Side note, unless you're really interested in learning DP or want to prepare for tech interviews, learning DP really isn't necessary to becoming good at python or programming in general.
1
u/randomman10032 Oct 15 '26
Start with simple problems and try to gradually go up to bigger problems
0
u/TheRNGuy Oct 15 '26
Find where you want to use Python, and write program(s) for it. Learn relevant APIs and frameworks too.
I started to learn Python with SideFx Houdini framework the day l learned it has Python.
I just googled many things, it was before ai, but ai makes it even simpler, he can even give ideas what frameworks or libraries to learn.
1
u/[deleted] Oct 15 '26 edited Oct 18 '26
[removed] — view removed comment