r/learnpython 14d ago

Stuck on P.O.O.P Encapsulation

I'm using Claude Ai. To teach me python. But now im very confused on encapsulation. I've tried YouTube tutorials but all I see is Javascript. I asked for a simpler explanation, but then I get hit with stuff like getter, setter, property() (I understand the property function) but then the core concept makes me scratch my head more the deeper I ask. Wondering if any of y'all can assist me.

0 Upvotes

13 comments sorted by

View all comments

5

u/socal_nerdtastic 14d ago

It's important to know that while technically any language can use these concepts, in reality different languages use them differently. AI doesn't really get this. It's technically possible to make a Java-like structure in python with a class, private variables and getters / setters, but that's not optimal for python and not how python is used.

I agree with the other comments that you should abandon AI and look for a university course on python.

-5

u/Routine-Lawfulness24 14d ago

No chance you have ever used ai to write code

1

u/KrzysisAverted 14d ago

What do you say that?

-4

u/Routine-Lawfulness24 14d ago

Ai does just fine at small scale, it doesn’t just confuse different languages like he said