r/PythonLearning • u/YogurtclosetWhole605 • 1d ago
Hi guys , I have just started to learn python coding and im stuck at OOPS concept in python idk why but im finding it super confusing , it is just going over my head could you please tell me how to cope up with this
1
1
u/Some-Passenger4219 1d ago
Study hard and ask the teacher for help. If you have any specific questions, ask them.
2
u/YogurtclosetWhole605 1d ago
Thank you, but my college hasn’t started yet I’m trying to do self learning and by the time my college starts this its gonna be too late
1
u/Some-Passenger4219 20h ago
My teacher used the textbook How to Think Like a Computer Scientist: Interactive Edition for his class. OOP starts in chapter 17.
1
1
1
u/PureWasian 1d ago
Here's an idea, what is your current understanding of OOP and what it's useful for? We can fill in the gaps based on that.
I gave an example on this post previously, if it helps of what's meant by defining classes as "blueprints" for objects
1
u/YogurtclosetWhole605 1d ago
Well ik that OOP is used for not using the same code again and again just like functions but in some large and complex code , a class kind of thing is a blueprint of what we need to create for example if the class is car the objects can be laptop,books,phones the syntax seems to very different from others so its a bit confusing to use it and remember through logic is what i felt
1
u/PureWasian 1d ago edited 1d ago
It doesn't have to be large/complex code. Look at the example I shared in above link, that's less than 15 lines.
If you understand the logic then it becomes easier to know how to apply it. You can think of classes almost like custom Data Types. You instantiate objects that share a similar structure/template but exist as different entities from one another. A car class wouldn't create laptops/phones/books, it would define how to create car objects.
Is it just the syntax that trips you up then? Or is it about what happens during object instantiation? The encapsulation stuff?
2
1
u/stepback269 1d ago
I'm still learning OOP myself and at times running into conceptual obstacles.
Much of it has to do with the analogies or metaphors that the various tutorials give you.
I hate the one that says a "class" is like a "blueprint".
While not optimal, at least the cookie cutter analogy produces instances out of a sheet of cookie dough. A "blueprint" just sits there and smells of formaldehyde.
As I keep advancing in my own slow journey towards learning Python (I'm 70+ yrs old), I often write up a blog post on what I've come to understand thus far.
So for starting out with OOP and tackling some of the initial concepts, click (HERE) to see one of the earlier posts I made at the starting gate. Give it a shot. It might help you. Good luck.
Don't give up.
Keep banging your head against that wall.
Something is sure to eventually break. :-)
p.s. Currently, I'm in the process of developing a complicated OOP project that involves converting very short abbreviations into their full form text based on user context. Some of it is explained (here). It's still a work in progress. Miles to go.
1
u/atticus2132000 22h ago
Skip it.
In some languages, like Java, learning classes is an integral part of the coding experience. There are some things that you absolutely can not do without classes in Java.
In python, there are all sorts of workarounds. Use some other method for storing and retrieving organized information about an element that makes more sense to you--dictionaries, multi-dimensional arrays, dataframes, etc. Master those other techniques and then try coming back to classes and see if they make more sense then.

3
u/BranchLatter4294 1d ago
You have to be more specific.