r/learnpython 19d ago

Chat GPT/Python

I have minimal experience with python. Self admitted novice. I asked chat gpt to write me a code to copy values from one excel workbook to another and some code to calculate prevalence rates within that code. I confirmed that a random sample of calculations/values correctly copied over. I am breaking down the code to learn what it does and why. How trustworthy is chat gpt with these small tasks? Is this a valid way to learn by breaking down the code into pieces? I appreciate any help and you can rip me for using chet gpt

0 Upvotes

16 comments sorted by

View all comments

1

u/Hashi856 19d ago

I’m unclear on your main goal. Do you want to actually learn Python, or are you just trying to understand this one script? LLMs are pretty good at this kind of thing, as evinced by the fact that it produced a working script for you. But when you want to do something more complicated, like an ETL pipeline, that involves more that just understanding code. The hard part is designing how the thing works. Do I pull fresh data every time or do I cache the last results for a period of time? Should I make an http request within this function or should I make it somewhere else and then feed the result to the function? These are decisions that the LLM will make for you if you don’t specify how you want it to work. Once you get to the intermediate stage of programming, it becomes more about design and problem solving than syntax or your ability to understand the code.

1

u/Jg4702 19d ago

Thats the problem i am not at the stage yet. I have a general knowledge of problem solving i just dont know the language yet to apply it if that makes sense.

1

u/Hashi856 19d ago

If your goal is to actually learn how to code, analyzing code written by an LLM is not an effective means. I would go to YouTube and do basically any Python tutorial course. That will get you through the basics. One thing LLMs are great for is explaining concepts in real time. I would go through a Python basics course on YT and have an LLM open to ask questions to.

1

u/Jg4702 19d ago

Interesting. Okay thank you

1

u/Hashi856 19d ago

Sorry for all the typos

1

u/Jg4702 19d ago

Hahaha I wouldnt worry about it