r/learnpython • • Aug 09 '24

What is the best way to learn Python in 2024?

Hi everyone,

I started working as a Data Analyst a year ago without
any coding experience and started to complete video courses on Udemy.com,
as this was recommended to me as the best way to get started with improving
your coding/Python skills. While the courses has significantly improved my
understanding of the fundamentals of Python and what it actually means to
"code", I find myself only using ChatGPT to generate the code, not
writing anything myself.  

The courses I have been taking was created in
2020 before the release of ChatGPT. Obviously the courses does not mention
anything related to using AI to speed up the process of coding. This got me
thinking: Since the process of coding has changed significantly with the
availability of AI/ChatGPT, are video courses like these still the best way to
learn how to code in Python? Is it still necessary to learn how to manually write
the code yourself or is it more important to learn the possibilities of Python
and how to prompt using AI and then have AI write out the code for you? Would
you still recommend courses like these to people getting started with Python or
is there something better out there?

 

3 Upvotes

29 comments sorted by

20

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 Aug 09 '24

I find myself only using ChatGPT to generate the code, not writing anything myself.  

And I find it hard to believe you're actually learning by letting an LLM write the code for you, even if you read it afterwards. The more you get used to doing that, the more you become reliant on such tools and may end up being unable to write anything on your own.

Since the process of coding has changed significantly with the availability of AI/ChatGPT, are video courses like these still the best way to learn how to code in Python?

I wouldn't say it has changed significantly. Most people who use AI tools use them for boilerplate code, and most certainly not everything. ChatGPT cannot think, so it cannot solve problems it's never encountered before.

Is it still necessary to learn how to manually write the code yourself or is it more important to learn the possibilities of Python and how to prompt using AI and then have AI write out the code for you?

Never blindly trust AI-written code. You should always be able to write the code yourself, and check the validity of any generated code.

Would you still recommend courses like these to people getting started with Python or is there something better out there?

There's no learning material that's best for everyone. If video courses work well for you, use them, but others would prefer written courses (the Python MOOC is my personal recommendation) or books (eg. Automate the Boring Stuff with Python).

3

u/Individual-Arm6778 Aug 09 '24

Thank you for the response. Recently I have tried to increasingly write out the code myself and it has definitely had an impact on my coding skills, so I agree just copy pasting the code is not the best way to learn.

And I tried to create an app just to experience working on a bigger project but gpt got lost and wasn’t able to help me in the end because it got too complicated.

I will check out the written learning material :)

2

u/mixedd Aug 09 '24

Not to steer off topic, but is there a big difference between CS50P and MOOC?

5

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 Aug 09 '24

Both are roughly equivalent, CS50P might focus more on computer science than software development - I haven't tried it myself so I'm basically making an educated guess, though.

I'm sure you can't go wrong with either. It's mostly a matter of preference.

2

u/mixedd Aug 09 '24

Thanks

2

u/SamuliK96 Aug 09 '24

Doing both is also an option. They have a bit different focus, doing both doesn't hurt either

2

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 Aug 09 '24

True, although personally I'd suggest moving on to creating projects after finishing either one.

10

u/[deleted] Aug 09 '24

Generative AI will be a part of coding forever. At the same time, "generative AI user" will never be a job. If you can produce the code you need without needing to know about code, then your employer can do it too - there is no reason to hire you. If this is your approach to coding, what do you think your value-added is?

0

u/Individual-Arm6778 Aug 09 '24

Makes sense and I absolutely agree. This is also why I like the part of the course teaching the fundamentals of python. However the part going through a series of basic functions and methods seemed a bit redundant

1

u/[deleted] Aug 09 '24

Maybe it's too slow-paced for you? That's one thing, but I wouldn't call it redundant or obsoleted by ChatGPT. You don't have to memorize that "Foo".lower() == "foo" and ChatGPT will probably always get that correct, but it's faster to recall it than look it up, and practice with methods is valuable in itself.

11

u/Lewri Aug 09 '24 edited Aug 09 '24

ChatGPT hallucinates, it cannot create complex systems, it does not properly understand code optimization. You also cannot feed sensitive information into ChatGPT.

Using ChatGPT without a full understanding and without double checking everything is frankly dangerous.

1

u/Individual-Arm6778 Aug 09 '24

I definitely agree that you should be careful with gpt and ai in general. How much experience do you have working with python and are you not using gpt when coding? Very curious on how the availability of ai has influenced the process of programmers that were already coding before it was released

1

u/Lewri Aug 10 '24

I finished my studies (physics) shortly before ChatGPT came out, and started my job about a year later.

My workplace has always had the policy that Generative AI tools have not been rated and have both safety and security issues. As such we are not allowed to enter any non-public corporate information, we cannot use our corporate accounts to access GenAIs, and we are not allowed to use any output without full checks. Recently, they took this a step further and blocked access on our networks.

A large percentage of my work involves looking at already existing systems to change a few things or to add new features. I can't simply plug this into ChatGPT, both because of the above issues and because they are large, complex systems. Occasionally, I will plug a small problem into ChatGPT such as "I have data in format x, I need format y" and I will ignore the vast majority of what it outputs but maybe take 1 or 2 lines and adapt them.

In the future, the company might have in-house solutions, based on open models, but the way that I use it will still be similar. Just occasional usage for individual lines.

1

u/KCRowan Aug 12 '24

My company doesn't officially use AI at all. Sure, some developers will use it occasionally when they forget how to use a particular function or whatever, but most of us find for larger pieces of work it's slower to get junk from gpt and have to fix it than it would be to just write the code ourselves.

2

u/dcl_58 Aug 09 '24

I recomend the 100 days of python course on udemy

1

u/Individual-Arm6778 Aug 09 '24

Thank you for the recommendation. I tried the 100 days of coding on replit when I just started learning python but I found it was too focused on developing games which is a bit outside of what I want to use python for. I’ll check it out :)

5

u/Bitwise_Gamgee Aug 09 '24

The best way to learn Python is to just use it. Lots of Googling and unavoidable now but I still won't recommend to use cGPT.

4

u/dabears91 Aug 09 '24

Build things. It’s ok to use ai and learn from it. Reality is that’s never going away. But what you have to learn is how to take a big problem and break it down into small pieces.

My recommendation is do like a 20 hour class, buy a book, do a few tutorials.

Then just build anything that you actually need. Only you can answer that for yourself.

If you are a data analyst then focus on pandas, automating tasks, etc. Just go make things.

1

u/ErasedAstronaut Aug 09 '24

I'm currently exploring a career in data analysis and I'm curious about your experience. How did you land your data analysis job, and do you enjoy it? I'm also particularly interested in how you use Python in your role — do you find yourself using it often, and if so, for what tasks?

3

u/Individual-Arm6778 Aug 09 '24

I got a masters in sports science from uni and got a student position in a startup that a couple of guys studying some years ahead of me started. I started working on a research project with the university but with time the position turned into a data analyst position with me working in excel and power bi with user data on our platform. When I finished at uní I got a government job, mainly because of my experience with power bi. In my current position I am using python for preparing datasets for a big yearly survey, mainly just exporting todays to excel and creating graphs. I don’t think it was planned for me to use python in my current position but I expressed interest in it and my boss gave me permission to do the udemy courses when work is slow

1

u/ErasedAstronaut Aug 16 '24

Thanks so much for sharing your journey! It's fascinating and inspiring to see how you transitioned from sports science to data analysis. It’s great to hear how you were able to integrate Python into your current role, even if it wasn't initially planned. I appreciate the insight—definitely motivates me to keep learning and exploring different paths!

0

u/NerdyWeightLifter Aug 09 '24

Dude, ignore these naysayers about ChatGPT.

We can understand that it's not perfect. None of us are.

What it does offer though, is an endlessly patient pair programmer, that is mostly correct, and that you can toil away with together, that will be endlessly positive, and you can work through all this bullshit together.

That's actually worth something.

Well, $25/month, if you'd like it to respond well whenever ...

P.S. When it tells you shit that doesn't work, just paste the result back at it, and it apologises and fixes the problem, without need of any battle of ego's. It's fantastic.

2

u/Individual-Arm6778 Aug 09 '24

Nice with a different perspective lol. I agree that the general quality of the output is quite high once you learn how to ask for what you need. Recently got a 150 script merging a few datasets, creating cross tabs in a df and exporting it to excel in just a few prompts. There’s always going to be issues with it if that is what you are looking for…

1

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 Aug 09 '24

When it tells you shit that doesn't work, just paste the result back at it, and it apologises and fixes the problem, without need of any battle of ego's.

Not necessarily. For example if you ask GPT 4o "which is bigger, 3.9 or 3.11", it answers "3.11" no matter what you reply to it. Even if you prove otherwise.

0

u/NerdyWeightLifter Aug 09 '24

Just to be sure, I went and tried your experiment, and sure, it got it wrong on the first shot, but once I explained why it got it wrong, it consistently understood, and for new/related problems too.

The real reason it went astray, is about token size, and that's almost never a problem when talking about higher level problems. Your example just doesn't apply.

OTOH, I've had it write whole complex Python functions together with tests and an explanation of how it was all supposed to work, and then if the code fails and dumps a stack trace, I simply paste the stack dump back into the same session that generated the code, and it fixes the problem.

You're making a mistake of judgement, by looking at trivial problems at the level of minor tokenization mistakes, and projecting that up to a widespread incapacity, which is totally invalid, and also assumes that you, the prompter, have no involvement in all this.

Just for instance, another word for "hallucination", is "creativity". The general setting for ChatGPT prompts is middle of the road creative, because on average people prefer that, but you can be clear about what you really want.

ME: "Now, I need you to be mathematically precise ... which is bigger, 3.9 or 3.11?"

ChatGPT: "
When comparing the numbers 3.9 and 3.11, it is important to interpret them correctly as decimals:

  • 3.9 is 3+910=3.903 + \frac{9}{10} = 3.903+109​=3.90.

  • 3.11 is 3+11100=3.113 + \frac{11}{100} = 3.113+10011​=3.11.

Now, comparing these:

  • 3.903.903.90 is clearly greater than 3.113.113.11.

Thus, 3.9 is greater than 3.11.
"

You are part of the very problem you complain about.

-2

u/NerdyWeightLifter Aug 09 '24

So ask better questions, instead of trying to trick it.

Somehow people forget that they're actually part of the process.

1

u/[deleted] Aug 10 '24

I started my Python journey with Codeacademy. The format worked for me. Small snippets of text + code and a sense of completion. I also liked Datacamp.

1

u/looseitalia Aug 10 '24

HAHAHAAHAHHA everyday the same post lmao

Dude just read the other posts!!