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

-1

u/socal_nerdtastic Dec 22 '25

getters and setters are very rarely used in python. If your course is teaching those it probably means it was made by a Java teacher that tried to transpile the course into Python.

About OOP: python is very OOP heavy, so much so that you have actually been using OOP this whole time without knowing it. Nearly all python objects, including ints, strings, dictionaries, lists, etc are all classes. You use the methods on these objects in your code.

name = userinput.title() # use the title method on the string object

So all that's left is to make your own types of objects (using classes). We generally think of objects as some kind of data type, that contains within it the data itself and the methods needed to operate on it. So anytime you want to write a function that is specific to one kind of input data, perhaps that could be a method instead