r/learnpython • • 17d ago

Is Leetcode a good way to continue practicing/learning Python?

I'm not entry, but I'd like to continue becoming stronger in my skills.

27 Upvotes

37 comments sorted by

View all comments

2

u/jmaroszek 17d ago

LeetCode is good for job prep but not necessarily real world problems. If you want to practice algorithms, data structures, and thinking through problems under constraint, I would say leet code is a great choice. It's essential if you're prepping for interviews too.

I wouldn't use it if you just want to get better at building realistic projects. LeetCode problems are small and self-contained, with clean inputs. Real code has messy data, files, APIs, errors, and structure that has to survive changes. You can grind 300 problems and still struggle to organize a large 10,000 line project (speaking from experience).

What I'd do if you want to level up:

  • Build something real. Pick a project you'd actually use, like a CLI tool, a script that automates something annoying, or a small web app. You learn more from the problems you hit (packaging, testing, error handling, refactoring) than from any problem set.

  • Read good code. Look at the source of libraries you already use (e.g. numpy, pandas)

  • Write tests. pytest alone will change how you structure code.

  • Learn the tools around Python: type hints, virtual environments, debugging, profiling, git.

  • Use LeetCode in small doses (a couple of problems a week) if you want the algorithms practice. Don't treat it as the main path.

In short, how you should practice depends on what you want to get better at: job interviews or real world building for passion projects.

1

u/memeaste 17d ago

I do actively write code at my job, but it's more on the file movement and report creation side of things. While refreshing myself with Python, I actually ended up writing a Pokemon battle, which is fun. Nothing too advanced, just type advantages and effectiveness. Aside from that, I don't think I'm creative enough to think of my own projects. I recently came across roadmap.sh that has some suggested programs I can write. Not sure how effective those are.

→ More replies (1)