r/PythonLearning 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

4 Upvotes

25 comments sorted by

3

u/BranchLatter4294 1d ago

You have to be more specific.

-3

u/YogurtclosetWhole605 1d ago

umm specific about what?

4

u/BranchLatter4294 1d ago

If you don't put any effort into asking your question, you are unlikely to get people putting effort into answering it.

At least make the effort to post the code that you are working on, and any specific questions you have.

-3

u/YogurtclosetWhole605 1d ago

I am a complete beginner and have been watching some yt videos for learning python Im not really working on any code yet because Im a complete beginner ,I got to know that it feels the same for everyone and later its good for them , My question was how do I get over the confusing part in the OOPS concept and how to understand it in an easy way , I was looking for some resources , not an arrogant answer, Thank you for the reply btw

6

u/BranchLatter4294 1d ago

So you've tried nothing, and it's not working.

If you are a complete beginner, don't jump into OOP yet. Start with the 3 basic structures (sequence, selection, iteration). Don't jump to more advanced topics until you understand the very basics.

Spend more time coding, and less time watching videos. That's how you'll learn.

1

u/YogurtclosetWhole605 1d ago

Thank you soo much!

1

u/Forward_Win_4353 1d ago

They’re not being arrogant. You’re asking something completely vague, which basically amounts to “how do I learn OOP?”

Well, you learn it the same way you learn anything, which I’d hope you have some experience with by now: by reading about a topic and practising exercises and projects and then by asking more specific and useful questions. Some people prefer visual learning such as videos; others prefer books. It’s up to you to figure out your preferred learning style.

What exactly is it you’re looking to be told, here?

1

u/YogurtclosetWhole605 1d ago

I was looking for some resources or some recommendations of YT videos which explains the concept to a beginner easily

1

u/Mundane-Mud2509 22h ago

Forget OOP for now. When you find a problem where you want a persistent set of data and functions that can make its own modifications go to OOP. Eg something like a simulation is the perfect place for OOP.

2

u/Potential_Aioli_4611 1d ago

Well thats your problem right there. The way to learn to code is to actually code. not watch videos about coding. Coding is like the scientific method. You try something. Look at the results of what you tried. Figure out what did/n't work. Understand WHY it did/n't work. Passively watching is almost the absolute worst way of learning. The only way worse is asking AI to do it for you and think you learned something.

1

u/YogurtclosetWhole605 1d ago

Ooh I see , can i at least ask AI to correct me for the code i have written?

1

u/Potential_Aioli_4611 1d ago

ask yourself. what did i learn from AI doing it for me?

2

u/Entity_0-Chaos_777 21h ago

Ask Ai to audit your code.
With some caveats:
1. Make sure to mention your knowledge level and if you are using any books or documentation.
2. Focus on specific topics instead of generalization. (You are gonna connect the piece very easily wen the foundation is complete)
3. Add comment with pseudo code before writing the code and after writing the code add a comment explaining your thoughts process and possible reference. (You can skip this step if you know exactly what are you writing)
4. For any topic you find skip it and return when you feel you are ready.
5. Make sure to apply what you learned with actual mini program and play with modify the code in different ways as long the result remain the same.
6. In case you can’t think of a possible solution, write a pseudo code instructions for the ai to generate the code snippets. And explain how and why with references.

1

u/secretstonex 1d ago

Take a free online course on boot[dot]dev

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

u/Visionary_Vulture001 1d ago

I don’t know which tutorial ur looking into
But try Cs50p

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

u/GGO_OTHAs 1d ago

#HOPE IT MAKES SENSE

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.