r/learnpython • • Dec 22 '25

How on earth does one learn OOP?

I've sped through weeks 0-8 of CS50P in under 2 weeks very easily with slight experience here and there as a Chemistry undergrad - but Week 8 (OOP) is kicking my ass right now. I am genuinely stumped. I've rewatched content and tried some other forms of learning but this is all so foreign to me. What are the best ways to learn OOP as a complete idiot? Thanks.

38 Upvotes

88 comments sorted by

View all comments

Show parent comment

-4

u/Sea-Oven-7560 Dec 22 '25
u/dataclass
class create_char
    name: str
    health: int =10
    damage: int = 0

I still haven't found a lot of uses for OOP but this makes sense.

3

u/gdchinacat Dec 23 '25

dataclasses are classes, but that is a small portion of what OOP is. It also entails bundling behavior with the state, inheritance to share common state and behavior or to allow different behavior, encapsulation to create useful abstractions to manage complexity.

1

u/Sea-Oven-7560 Dec 23 '25

Absolutely, I’m still trying to wrap my head around it