S
22

I copied a chunk of code for my first Python script and now I'm conflicted

I began learning Python recently and tried to create a simple number guessing game as practice. Everything was going fine until I hit a wall with validating user input. I spent a couple hours stuck, then looked up solutions on a coding forum. I found a piece of code that fixed my issue instantly, so I added it to my project. Now my program runs, but I feel guilty because I didn't write that part myself. I worry that relying on ready-made code like this will stop me from truly understanding how things work. At the same time, getting unstuck helped me finish the project and feel a bit of success. How do you balance using outside code with making sure you're actually learning as a beginner? Do you think it's wrong to copy snippets when you're just starting out?
3 comments

Log in to join the discussion

Log In
3 Comments
violab76
violab761d ago
Everyone hits walls with input checking when they start, and grabbing a fix from online is how most people learn. Finishing your game gives you momentum, and you can always go back to study the copied code later. You'll build real understanding over time, so don't stress too much about one copied bit.
9
the_wade
the_wade1d ago
Been there, just break down what @violab76 suggested later.
8
lane.eric
lane.eric6h ago
Yeah getting that first script to run is huge for morale. I straight up copied a file reading function once, then the next day I tried to write it again from memory. Messed it up twice but then it clicked, lol. The trick is using the copied code as a temporary fix, not the final step.
4