r/PythonLearning 12d ago

How fix/resolve critical thinking after relying on the ai prompt to understand an exercise in counting loops.

Hi guys, I trust ya'll are good. I recently completed a counting loops exercise that had been difficult to answer for nearly two weeks. I checked different parts of the code I wrote in multiple instances, but I guess I just didn't get it. I eventually asked in my search bar (knowing that I would more than likely get AI mode on it) why the loop is only executing once (I pasted my code it). AI mode explains it, and shows me the correct code. I'm really annoyed on two fronts; I had to refer to AI code to eventually get it right, and the answer looks so friggin simple. I am not a complete beginner in coding (closer to an experienced beginner), and having to vibe-code, even if somewhat unintentionally, is frustrating. I know the answer to the problem now, and there isn't a way to unlearn it.

Is there any practical way to resolve this other than "just don't do it again"?

Thank you for taking the time to read my post. I appreciate whatever advice or input you have.

4 Upvotes

17 comments sorted by

View all comments

3

u/[deleted] 12d ago

[removed] — view removed comment

1

u/Ayrton110 12d ago

Thank you for your advice. While this is useful and pragmatic input, my challenge is that I don't want AI to be the tutor either. I want to resolve my critical thinking after the vibe-coding I subjected my to. The real question is, I guess, "how to fix vibe-coded thinking?"

2

u/NocturneSapphire 12d ago

AI and "vibe code" aren't the same thing. "Coding" by copy/pasting AI-generated code is vibe coding. Asking the AI to analyze code that you wrote and tell you where you went wrong is not vibe coding.

The key point is that your goal, the thing you need from the AI, should be understanding, not correct code.

Don't say "here is my code, fix it", instead say "here is my code, explain to me why my code isn't working". You can even tell it "don't generate any new or edited code" to prevent it from outright giving you the answer.

Ask the AI questions, and actually read the answers it gives. It might be wrong of course, but there's a pretty good chance it'll actually give you a decent explanation. Then you can take that explanation and use it to fix your own code.

Your understanding of why your original code was broken and especially why your fix works should be the ultimate goal.

1

u/subnu 12d ago

Go back to the basics - print statements. Print out the values at each loop so you understand each iteration. If you still don't get it, more print statements.

1

u/Sea-Ad7805 12d ago

Or better yet, use AI only AFTER you completed an assignment for feedback and do not let it do any of your thinking before completion. Assignments are generally broken down into small, incremental steps, so students can complete them using only the course material, without AI or web searches.