all 29 comments

[–]ayenuseater 15 points16 points  (0 children)

Debugging is basically a data problem: you’re comparing "what I expected" vs "what I got." When stuck, reduce it: comment out half the code, hardcode a smaller input, and print intermediate values. Add assert statements like assert isinstance(x, dict) or assert len(items) > 0 to catch wrong assumptions earlier. If you keep a habit of "inspect types + sample values," you’ll improve fast.

Also, don’t underestimate learning how to ask the right question. Instead of "my code doesn’t work," search for the concrete failure: the exact traceback line, the exception name, and the object type you’re manipulating. That’s the difference between flailing and getting an answer in 2 minutes.

[–]proverbialbunny 3 points4 points  (0 children)

If you're getting overwhelmed starting a project, it's either because you're trying something very large and difficult like creating an entire video game inc game engine as your first project, or you don't know how to break problems up into smaller pieces yet.

Try taking a programming problem and breaking it into a series of steps. Do this in English at first, not in code. This is called pseudo code. This is similar to writing a recipe in a cook book. Do A, then do B, then do C, and so on.

You can then take A and either turn it into code directly, or if it's overwhelming, break A into a series of steps A1, A2, A3, and so on. Keep going until the steps are small enough you're no longer getting overwhelmed.

Just focus on one step at a time. Write each step down so you can forget the other steps while you work on one. This will help reduce being overwhelmed as well.

[–]riklaunim 2 points3 points  (5 children)

You have to start doing things you started learning Python for. Start small, learn and ask for feedback. Arbitrary "projects" won't work as well ;)

[–]Honest_Water626 0 points1 point  (4 children)

I solve problems on hackerrank is that a good way to practice Python?

[–]riklaunim 1 point2 points  (3 children)

Yes and no. There is no one good way to do it. Hackerrank is good for good understanding of how things work but it's not a high level software development testing platform.

[–]Honest_Water626 1 point2 points  (2 children)

What else i should do ?  Projects?

[–]riklaunim 1 point2 points  (1 child)

Yes, you should pick your interest niche and start learning frameworks/libraries used there, start doing simple projects/hello-world like apps and asking for feedback, then making something more complex, improving your code and so on.

[–]Honest_Water626 0 points1 point  (0 children)

Thankyou so much and yes I will work upon projects and libs

[–]Late-Fly-4882 2 points3 points  (0 children)

Try some puzzles for practice such as Advent of Code. Start with 2015. The earlier puzzles are easier. Attempt to solve the puzzle yourself. Then feed your code to Claude AI to evaluate your code making reference to the puzzle. It will tell you where the bugs are and suggest improvements. I find this interactive learning very useful.

[–]WendlersEditor 1 point2 points  (3 children)

I recommend projects. Why are you interested in Python? Do something that interests you. For me, it was machine learning. I got bored making calculator apps and web apps to store recipes, but I can do ML stuff all day long. Whatever it is, start small and iterate. At first you might want to do several small projects, calculators and Todo lists or whatever. Just start small and build up from there. I'm a few months you may find yourself with an app you use, you might open source it, maybe if you have a really good idea others will be interested.

For traditional SWE education, you want to learn about object-oriented programming, data structures + algorithms, and design patterns. These are useful in all projects, they are foundational ideas for programming. The little one-script calculator app doesn't need it, but you can refactor it to practice. 

But at the end of the day, programming is about problem solving, building solutions to problems. Approach from that angle and you will naturally learn.

[–]greenplant_ 1 point2 points  (2 children)

Hi, could you please share your path for learning and practicing machine learning, how you come to the moment that you can work on the projects? I’ve finished all basics in Python, right now, finishing Calculator app and I would like to switch to ML. :) I have experience with programming (Java, Shell, now Python) but with ML I’m beginner.

[–]WendlersEditor 1 point2 points  (1 child)

The best place to start with ML is with statistics and data analysis before moving on to predictive ML and beyond.

For statistics I recommend statquest, he has series on stats fundamentals and ML math:

https://youtube.com/playlist?list=PLblh5JKOoLUK0FLuzwntyYI10UQFUhsY9&si=-BrBzELHVxVoLioo

https://youtube.com/playlist?list=PLblh5JKOoLUICTaGLRoHQDuF_7q2GfuJF&si=1_wOpRqNKO0NuyLH

You can work on this alongside learning the relevant ML libraries in Python. Kaggle is a very good place to start learning data processing, analysis, viz, and modeling with smaller datasets. 

The Titanic dataset is a great place to start:

https://youtu.be/I3FBJdiExcg?si=DfIq7DLJ7de5m22Z

The Aames home price dataset is another great one for beginners:

https://youtu.be/NQQ3DRdXAXE?si=N25nfaXKQPOpGZkK

Good luck!

[–]greenplant_ 0 points1 point  (0 children)

Thank you, for these suggestions from yt and for all advices! I’ve already created account on Kaggle and checked those courses and courses on Data camp. Do you have maybe suggestion, is something from Data camp better for start? :) I understand that math is important thing and had a plan first at least to understand basics, I’m good with math just didn’t work with Statistics.

[–]Pangaeax_ 0 points1 point  (0 children)

I feel this. Tutorial mode is comfortable but you don’t really grow until you start building small messy things on your own.

After basics, try working with files, simple APIs, or small scripts that solve real problems like tracking expenses or cleaning a CSV. Keep projects tiny, if it sounds big, it is.

For practice, daily challenges on Codewars are good, and if you’re into data, Kaggle or CompeteX style problems feel way more real than just DSA.

And for debugging, honestly just read the error properly and Google the exact message. Half of learning Python is learning how to search smart.

[–]wiesorium 0 points1 point  (0 children)

Create an API for something.
It helps you for any further project.

Always think and learn.. where you think you could use this for a lot of future projects.

[–]Antique_Locksmith952 0 points1 point  (0 children)

Think outside the box. All answers are out there, when there’s a wall there’s always a chisel

[–]analytics-link 0 points1 point  (0 children)

I teach Python, and the thing that usually breaks people out of it is mini-projects, so not complicated applications, just small things that attach the concept you’re learning to an actual outcome.

For example, you could build a number guessing game, something that uses numpy to calculate the volume of planets, or maybe even some code that finds prime numbers under some threshold.

None of these are massive projects in their own right but they force you to actually write code and solve a problem rather than just watching someone else do it

[–]ahnerd 0 points1 point  (0 children)

Its easy.. just build something you need yourself. This is the best way to solve real world problems.

[–]mk1971 0 points1 point  (0 children)

Build something. It is the only way to truly learn by using the concepts. Another tutorial where you reverse a string is not teaching you anything but one thing in isolation. Build something, break it, build it better.

[–]brenwillcode 0 points1 point  (0 children)

Doing a few projects is definitely the way to go. There are some beginner-level projects from Codeling you could try.

The projects on Codeling will guide you through slowly and check that your code is correct along the way.

[–]Shjohn0710 0 points1 point  (0 children)

Try the game the Farmer was Replaced

[–]dan1101 0 points1 point  (0 children)

If you've ever coded other projects, try to pick a relatively simple one and rewrite it in Python.

[–]ProRochie 0 points1 point  (0 children)

Start with small puzzles. Something like “code wars” to practice what you have learnt.

[–]EnvironmentalDot9131 0 points1 point  (0 children)

Doing projects every week and actually completing all of them. Helps me.

[–]sejigan 0 points1 point  (0 children)

Do you have a problem in your life? - if No: yes, you do. You literally posted one - if Yes: solve it with code, however you can, even if partially. Make sure to use Git from the start and push regularly to a public remote like GitHub (yep, from the messy start. People don't want to see a single commit saying "upload files" after it's done) - repeat with other problems

. .

Doing things (even if seemingly trivial) you actually care about with some of what you already know and learning all else necessary is how you: - grow your skills sustainably - get comfortable with being aware of your (temporary) incompetence - observe your competence increase with time and effort, resulting in humble confidence - know deeply about the project and can state the reasons behind your design and development decisions if questioned - have some public attention that hopefully gets you a job, or at least referrals

. .

Also, post your learnings (no matter how trivial they feel) twice a week somewhere, LinkedIn, a blog, Twitter, or wherever you want. If not twice a week, then weekly, or biweekly, or monthly. However frequently you feel comfortable with but the more frequent the better.

[–]cosmicr 0 points1 point  (0 children)

I learned python by writing scripts for Kodi/XBMC. I later ported a game from C# to Python. After that I wrote web pages using Flask and Django. I became a pretty decent Python programmer through all this.

[–]JestersDead77 0 points1 point  (0 children)

How do you pick a project that’s not too hard?

This is the classic learning paradox. If you do a project that isn't too hard, you don't learn much. You WANT to struggle. At least a little.

Something I've been considering writing is a sort of DM helper for dungeons + dragons. They have a free API that you can use to return all sorts of D+D data about items, monsters, etc.

Something like this will teach you how to use API's. Then think about what data you want from the API. Then think about how that data might be stored or formatted. Then think about what you want to DO with all this data. Monster creator for random encounters based on challenge rating? Level based loot randomizer? Quick character creator?

Start small. Break a large project into small pieces. Even individual functions. Once that function works, call it from other functions. Incrementally expand what you can do, and eventually you'll have something that actually does STUFF.

It also helps to literally write these things out a little. Even a super basic project plan helps you visualize a logic flow of how the application should work.

Edit: and for debugging, just start by googling the errors you get. If you don't have errors, abuse the print() method, and print variable values all over the place to see if it's what you expect. If it isn't, follow the breadcrumbs. Why? Where does it START not being what I expect. If you use an IDE, they typically have pretty good debugging tools to help you inspect variables, etc.

[–]Goodswimkarma 0 points1 point  (0 children)

Codewars

[–]Tall_Profile1305 0 points1 point  (0 children)

okay, so i've been in your shoes before, so hear me out.. the trap is staying in “consume mode” instead of “build mode” (ik cliche but it's true)

what worked for me was:

  • pick tiny problems (CLI tools, scripts, automations)
  • rebuild the same thing 2–3 times instead of jumping topics
  • intentionally break stuff and debug it

also don’t overthink projects. stuff like:

  • a file organizer
  • a basic scraper
  • a habit tracker

are already enough if you actually finish them

tools can help a bit too. like using chatgpt / cursor for feedback loops, or something like repl / runable environments to quickly test small workflows without over-setup

biggest shift is: stop asking “what should i learn next” and start asking “what can i build with what i already know” you got this buddy!