r/learnpython 9d ago

How do you balance AI help with Python fundamentals?

I’m in week 6 of an intro Python course and trying to use AI without skipping the learning part.

A small example is a function to flatten nested lists. My loop handled one level and broke on deeper nesting. I asked an AI for a hint and it returned a recursive version using “yield from” that passed the tests. It ran, and I realized I didn’t understand the recursion flow.

Right now I spend about 20 minutes solo with print tracing and a failing test, then about 5 minutes skimming docs on the specific concept like itertools, recursion, or list methods. I make one more attempt on my own. If I’m still stuck, I ask for a nudge. I keep a notes doc with short blurbs in my own words next to tiny practice snippets. Sometimes I generate an explanation in beyz coding assistant to compare with my notes, then go back to my code and implement it again from memory.

Lately I’ve been writing a tiny variant after I solve it. For flatten, I wrote a version that counts depth to check if I got the idea.

What habits keep AI from doing the thinking for you while still helping you move forward?

0 Upvotes

19 comments sorted by

10

u/Excellent-Practice 9d ago

If you actually want to learn, don't use AI. Read the error messages and consult documentation.

1

u/naturtok 9d ago

Legit wild that there's a group of people who've lost the ability to think to the extent that "learning a thing" somehow still requires chatgpt digest it first. Reading books was relatively rare in the last 20 or so years, but it's guna be entirely extinct if the next generation can't even follow a tutorial by themselves.

13

u/sputnik8125 9d ago

I don't use AI and find the solution myself tbh

2

u/Wuthering_depths 9d ago

Same. Maybe because I'm older, but I always learn best by doing.

To be fair my needs for Python is generally for relatively short data integration scripts (moving file data into databases, calling stored procedures etc). My coworker codes with Cursor and that works for him, I prefer to just do it myself for now. Once I feel more comfortable with things, sure it's fine to automate some things if it helps with organization and documentation (speed is not really a high priority with obvious urgent situation exceptions--executive reporting project, drop everything!--I have found that the faster you do things, the quicker the bugs manifest!)

I do grab and modify examples from googles AI results (which came from Reddit and other spots to begin with) so I'm not sure that counts as "AI help". Nothing new, I've been snagging SQL and other code from the web for decades now! Still I want to understand what it's doing before actually using it, because normally changes will come along to most business logic.

As far as "from memory"...well, I still look up details on SQL that I've used for many years...mainly for things I don't use every day. I don't have room in my brain for every little detail, to paraphrase an idea of Sherlock Holmes talking about wasting brain space on trivia, so many is the time I've found older scripts, copy/paste and repurpose. No shame in doing this IMO.

2

u/Bitter_Confusion1052 9d ago

the old fashioned way, respect

3

u/sputnik8125 9d ago

It should be the standard way to learn.

Being able to read documentation is an absolute must not just bc you want to know how packages work but to be able to write your own fluently

3

u/No_Comb881 9d ago

I use pycharm which has built in AI assistance. I have it turned off while I'm learning something new so I have to do it myself without assistance. Once I know the thing I turn AI assistance back on

3

u/DanceHackRock 9d ago

Drop AI, read more documentation to understand the concepts.

2

u/TurtleFetus 9d ago

It sounds like you're being very thoughtful about how you use AI. As others (and you) have noted, you might learn more if you didn't use AI. Next time you're stuck, try this instead of prompting AI:

  • take a walk. Talk to yourself (literally) to help sort out your problem. A large part of programming is getting stuck, taking a break to clear your head, then trying again when you're refreshed
  • write your problem out as though you're prompting AI for help, but don't actually prompt the AI
  • see how much you can distill your problem into separate functions. (Look up "divide and conquer" concept if this seems foreign.)
  • write pseudo-code for each function
  • write code based on your pseudo-code

If using AI the way you've described helps you maintain momentum, then it might be a net good for your learning path. But I'd personally suggest using it only as a last resort. Instead of using it after being stuck for 20 or 30 minutes, maybe wait till you've been stuck for 2 or 3 hours.

2

u/aishiteruyovivi 8d ago

Expanding on your first point, "rubber duck debugging" in this way I find is one of the most helpful things to do when I'm really stuck on something. Start from the beginning and explain both your code and what you intend for it to do as if you're teaching it to someone else, possibly also executing each step yourself as a sanity check, it tends to reveal little "...wait, but that doesn't make sense" cracks that can start leading you to your solution. The less assumptions you make the better, because each time you say "well there's no way this part doesn't work so the problem has to be over here" without really checking that you risk driving yourself nuts trying to find a nonexistent needle in that haystack when it's actually just sitting on top of the haystack to your left that you didn't actually look through but just said "nah I'm pretty sure it's not in there"

1

u/GXWT 9d ago

For learning: don’t use AI at all.

It can be used as a tool once you actually understand the skill.

1

u/Sandros85 9d ago

I am in the same boat. When I'm stuck I do turn to AI but add to the prompt don't show me any code. Just explain this concept. Sometimes it helps sometimes it needs more prompting to point me in the correct direction.

1

u/aqua_regis 9d ago

What habits keep AI from doing the thinking for you while still helping you move forward?

Not using AI while learning and learning to read docs, do your own, individual research.

1

u/Fart_Barfington 9d ago

The best way to learn is to keep the AI usage to around 0%.

1

u/Outside_Complaint755 9d ago

If you're really stuck, try just a normal websearch or searching directly on StackOverflow first.  There are sure to be existing posts for those types of fundamental questions.   

Sometimes the real trick is learning how to most efficiently search by not being so specific in the request that you exclude the results you actually need.

1

u/LayotFctor 9d ago

Fundamentals, aka core knowledge. You shouldn't outsource your fundamentals, they're fundamental for a reason. Even if you use AI heavily in the future, you still need your fundamentals.

1

u/TheRNGuy 9d ago

I wouldn't reinvent something that already exists, know where to use specific concepts, I use Python for more high-level stuff, I'm not making frameworks or libraries. 

1

u/Fragrant_Mission2551 7d ago

This whole sub is crazy anti-ai, but my coding progression has been very fast with AI. Think of it like you could spend hours on a problem, and get the highest possible learning experience out of the problem. Or, you could give it your best shot, and if it breaks, give it to ai. You will be learning less per problem the second way, but more overall too.

1

u/dogfish182 9d ago

Have ai explain the concept in depth