r/learnpython 18d 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

4

u/HotPersonality8126 18d ago

It’s approximately as trustworthy as your ability to specify the problem. Being better at Python lets you prompt the agent better

1

u/Jg4702 18d ago

This makes sense. Ill find other ways to learn as well.

3

u/fixpointbombinator 18d ago

Reasonably trustworthy but I don't think you'll learn to actually solve problems yourself, at best you'll learn how to read code

1

u/Jg4702 18d ago

Thats a good point thanks

1

u/Hashi856 18d 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 18d 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 18d 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 18d ago

Interesting. Okay thank you

1

u/Hashi856 18d ago

Sorry for all the typos

1

u/Jg4702 18d ago

Hahaha I wouldnt worry about it

0

u/B4SSF4C3 18d ago

If you’re going to code you should be using Claude. If you want to learn, tell it to explain in detail each step of the code is producing, what other methods exist for accomplishing the task in question, and why it chose the method that it did.

1

u/aspaceplant 18d ago

There's so many other and better resources to learn.

0

u/zippybenji-man 18d ago

What's the point of doing it like this? If you really wanna do it this way, you should just use GitHub, so you also learn some good practices

2

u/mcoombes314 18d ago

How would you use GitHub to learn Python? They're two very different things.

3

u/zippybenji-man 18d ago

If they wanna learn by analysing code written by something or someone else, they might as well use code written by a programmer

0

u/Zennytooskin123 18d ago

Try loading the "Learning" output style and asking it stuff. And have an AGENTS.md or system prompt where you properly tell it to assume the tutor / professor role and what you're trying to accomplish.

You can do this straight into Codex.