r/learnpython • u/Forward-Ride2950 • 20d ago
Trying to understand Class, Object, Instance, and self in Python. Is my understanding correct?
I'm currently learning OOP in Python and wrote down some questions regarding object and instance for following code
=
= ```
1) is ?
:- is
2) is ?
:- is and is
3) ?
:- is in is and
pass
50
Upvotes
View all comments
1
u/NothingWasDelivered 20d ago
Yeah, that’s about right. An object is kind of a programming abstraction that lets you combine properties and behaviors together. In Python, everything is an object, but that’s not the case in every programming language. In many languages, an integer, for example, is what’s called a primitive. In those languages, 4 has no properties, it has no methods or behaviors. It’s the representation of the number 4 in memory, for example.